[PATCH] dtc: Fix zero-length input segfault

Jon Loeliger jdl at jdl.com
Sat Feb 18 02:14:39 EST 2012


> This patch fixes a segmentation fault caused by dereferencing a NULL
> pointer (pos->file aka yylloc.file) in srcpos_string when the input
> length is 0 (fe 'dtc </dev/null'.) Reason: yylloc.file is initialized
> with 0 and the tokenizer, which updates yylloc.file via srcpos_update
> doesn't get a chance to run on zero-length input.
> 
> Signed-off-by: Horst Kronstorfer <hkronsto at frequentis.com>

Applied.

Thanks,
jdl


More information about the devicetree-discuss mailing list