diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-07 16:22:35 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-07 16:22:35 +0100 |
commit | 4224647c8d0990f8ffb17d8481655827161a94d4 (patch) | |
tree | 5a4983f484caf6ec8b676728f661d61b136f062d | |
parent | 46443a383cdd977d3b7644ffdac8041fa55e51da (diff) | |
download | busybox-w32-4224647c8d0990f8ffb17d8481655827161a94d4.tar.gz busybox-w32-4224647c8d0990f8ffb17d8481655827161a94d4.tar.bz2 busybox-w32-4224647c8d0990f8ffb17d8481655827161a94d4.zip |
hush: do not allow sh -c '{ echo boo }'
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/hush.c | 6 |
1 files changed, 4 insertions, 2 deletions
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, | |||
4533 | syntax_error_unterm_str("here document"); | 4533 | syntax_error_unterm_str("here document"); |
4534 | goto parse_error; | 4534 | goto parse_error; |
4535 | } | 4535 | } |
4536 | /* end_trigger == '}' case errors out earlier, | ||
4537 | * checking only ')' */ | ||
4538 | if (end_trigger == ')') { | 4536 | if (end_trigger == ')') { |
4539 | syntax_error_unterm_ch('('); | 4537 | syntax_error_unterm_ch('('); |
4540 | goto parse_error; | 4538 | goto parse_error; |
4541 | } | 4539 | } |
4540 | if (end_trigger == '}') { | ||
4541 | syntax_error_unterm_ch('{'); | ||
4542 | goto parse_error; | ||
4543 | } | ||
4542 | 4544 | ||
4543 | if (done_word(&dest, &ctx)) { | 4545 | if (done_word(&dest, &ctx)) { |
4544 | goto parse_error; | 4546 | goto parse_error; |