Commit f3a05c8f944ab2cd832e69a5705708ee7a1797fa
Committed by
Tom Rini
1 parent
dee332ffb7
Exists in
v2017.01-smarct4x
and in
37 other branches
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 <swarren@wwwdotorg.org> Reported-by: Przemyslaw Marczak <p.marczak@samsung.com> Signed-off-by: Rabin Vincent <rabin@rab.in>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
common/cli_hush.c
... | ... | @@ -3217,7 +3217,7 @@ |
3217 | 3217 | } |
3218 | 3218 | b_free(&temp); |
3219 | 3219 | /* loop on syntax errors, return on EOF */ |
3220 | - } while (rcode != 1 && !(flag & FLAG_EXIT_FROM_LOOP) && | |
3220 | + } while (rcode != -1 && !(flag & FLAG_EXIT_FROM_LOOP) && | |
3221 | 3221 | (inp->peek != static_peek || b_peek(inp))); |
3222 | 3222 | #ifndef __U_BOOT__ |
3223 | 3223 | return 0; |