[U-Boot] [PATCH 4/6] hush: fix segfault on syntax error

Simon Glass sjg at chromium.org
Sat Nov 1 16:11:56 CET 2014


Hi Rabin,

On 29 October 2014 16:21, Rabin Vincent <rabin at rab.in> wrote:
> Hush segfaults if it sees a syntax error while attempting to parse a
> command:
>
>  $ ./u-boot -c "'"
>  ...
>  syntax error
>  Segmentation fault (core dumped)
>
> This is due to a NULL pointer dereference of in_str->p in static_peek().
> The problem is that the exit condition for the loop in
> parse_stream_outer() checks for rcode not being -1, but rcode is only
> ever 0 or 1.
>
> Signed-off-by: Rabin Vincent <rabin at rab.in>

Acked-by: Simon Glass <sjg at chromium.org)
Tested-by: Simon Glass <sjg at chromium.org)

BTW I notice that I still get a crash with

./u-boot -c "''"

Regards,
Simon


More information about the U-Boot mailing list