On Mon, Dec 26, 2016 at 06:24:20PM +1300, Simon Glass wrote: > On 22 December 2016 at 12:59, Heinrich Schuchardt <xypron.glpk@xxxxxx> wrote: > > Running fdtdump without scan mode for an invalid file often > > results in a segmentation fault because the fdt header is > > not checked. > > > > With the patch the header is checked both in scanning as > > well as in non-scanning mode. > > > > Signed-off-by: Heinrich Schuchardt <xypron.glpk@xxxxxx> > > --- > > > > v2: > > Refactor header check as separate function. > > > > fdtdump.c | 27 +++++++++++++++++++-------- > > 1 file changed, 19 insertions(+), 8 deletions(-) > > Reviewed-by: Simon Glass <sjg@xxxxxxxxxxxx> > > nit: I don't think the function needs to be marked 'inline'. It is not > time-critical. Ah, yes. In fact, the 'inline' keyword should generally be avoided except in header files. The compiler nearly always has better information than you do about whether it's a good idea to inline a function or not. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Attachment:
signature.asc
Description: PGP signature