← Commit list

ef2386b80

Ron Yorston
Ron Yorston
2015-10-29
SUCCESS Duration: 233s

Subject

ash: only allow local variables in functions

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/ash.c+3 -0
@@ -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);
shell/ash_test/ash-misc/local2.right+1 -0
@@ -0,0 +1 @@
+./local2.tests: local: line 1: not in a function
shell/ash_test/ash-misc/local2.tests+1 -0
@@ -0,0 +1 @@
+local x=1