diff options
author | Eugene Rudoy | 2015-04-26 23:32:00 +0200 |
---|---|---|
committer | Denys Vlasenko | 2015-05-13 02:09:53 +0200 |
commit | 1285aa62f914ba894b82880e57bd81cfbc41f180 (patch) | |
tree | 17b1b5ea5ac4e277fc9b4555da8de6ca424fd314 /shell/ash.c | |
parent | a818777d4249e934ef7c9e6e7df8475d6692f315 (diff) | |
download | busybox-1285aa62f914ba894b82880e57bd81cfbc41f180.zip busybox-1285aa62f914ba894b82880e57bd81cfbc41f180.tar.gz |
ash: consider "local -" case while iterating over local variables in mklocal.
fixes segfault introduced in 0a0acb55db8d7c4dec445573f1b0528d126b9e1f with functions using "local -".
test-case: f() { local -; local x; }; f
note: with this change applied multiple 'local -'s still cause multiple entries to be added to the localvars list.
this problem will be addressed in a separate commit.
Signed-off-by: Eugene Rudoy <gene.devel@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index c51fb80..3e9997b 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -8979,7 +8979,7 @@ mklocal(char *name) */ lvp = localvars; while (lvp) { - if (varcmp(lvp->vp->var_text, name) == 0) { + if (lvp->vp && varcmp(lvp->vp->var_text, name) == 0) { if (eq) setvareq(name, 0); /* else: |