Commit a6e6c60e authored by Horst Kronstorfer's avatar Horst Kronstorfer Committed by Jon Loeliger
Browse files

dtc: Fix zero-length input segfault



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: default avatarHorst Kronstorfer <hkronsto@frequentis.com>
parent e280442e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment