From ef2386b80abfb22ccb697ddbdd4047aacc395c50 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 29 Oct 2015 16:19:14 +0000 Subject: ash: only allow local variables in functions Signed-off-by: Ron Yorston Signed-off-by: Denys Vlasenko --- shell/ash.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'shell/ash.c') diff --git a/shell/ash.c b/shell/ash.c index a2e0618..0d7cac0 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -8987,6 +8987,9 @@ localcmd(int argc UNUSED_PARAM, char **argv) { char *name; + if (!funcnest) + ash_msg_and_raise_error("not in a function"); + argv = argptr; while ((name = *argv++) != NULL) { mklocal(name); -- cgit v1.1