From: Rabin Vincent Date: Fri, 21 Nov 2014 22:05:22 +0000 (+0100) Subject: Revert "hush: fix segfault on syntax error" X-Git-Tag: v2015.01-rc2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f3a05c8f944ab2cd832e69a5705708ee7a1797fa;p=u-boot Revert "hush: fix segfault on syntax error" 128059b92 ("hush: fix segfault on syntax error") attempted to fix a segfault on syntax errors, but it broke Ctrl-C handling, and the assumption that it made, that rcode could not be -1, is incorrect. Revert this change. Reported-by: Stephen Warren Reported-by: Przemyslaw Marczak Signed-off-by: Rabin Vincent --- diff --git a/common/cli_hush.c b/common/cli_hush.c index d643912922..296542f4c2 100644 --- a/common/cli_hush.c +++ b/common/cli_hush.c @@ -3217,7 +3217,7 @@ static int parse_stream_outer(struct in_str *inp, int flag) } b_free(&temp); /* loop on syntax errors, return on EOF */ - } while (rcode != 1 && !(flag & FLAG_EXIT_FROM_LOOP) && + } while (rcode != -1 && !(flag & FLAG_EXIT_FROM_LOOP) && (inp->peek != static_peek || b_peek(inp))); #ifndef __U_BOOT__ return 0;