From: Denys Vlasenko Date: Mon, 7 Nov 2016 15:22:35 +0000 (+0100) Subject: hush: do not allow sh -c '{ echo boo }' X-Git-Tag: 1_26_0~84 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=4224647c8d0990f8ffb17d8481655827161a94d4;p=oweals%2Fbusybox.git hush: do not allow sh -c '{ echo boo }' Signed-off-by: Denys Vlasenko --- diff --git a/shell/hush.c b/shell/hush.c index 0bc67ecc9..a01db9c75 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -4533,12 +4533,14 @@ static struct pipe *parse_stream(char **pstring, syntax_error_unterm_str("here document"); goto parse_error; } - /* end_trigger == '}' case errors out earlier, - * checking only ')' */ if (end_trigger == ')') { syntax_error_unterm_ch('('); goto parse_error; } + if (end_trigger == '}') { + syntax_error_unterm_ch('{'); + goto parse_error; + } if (done_word(&dest, &ctx)) { goto parse_error;