summaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko2016-11-07 16:22:35 +0100
committerDenys Vlasenko2016-11-07 16:22:35 +0100
commit4224647c8d0990f8ffb17d8481655827161a94d4 (patch)
tree5a4983f484caf6ec8b676728f661d61b136f062d /shell/hush.c
parent46443a383cdd977d3b7644ffdac8041fa55e51da (diff)
downloadbusybox-4224647c8d0990f8ffb17d8481655827161a94d4.zip
busybox-4224647c8d0990f8ffb17d8481655827161a94d4.tar.gz
hush: do not allow sh -c '{ echo boo }'
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 0bc67ec..a01db9c 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;