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

Tom Rini trini at ti.com
Mon Nov 10 22:27:03 CET 2014


On Wed, Oct 29, 2014 at 11:21:40PM +0100, Rabin Vincent 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)

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20141110/0755416d/attachment.pgp>


More information about the U-Boot mailing list