aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Fox <pgf@brightstareng.com>2005-07-20 19:18:45 +0000
committerPaul Fox <pgf@brightstareng.com>2005-07-20 19:18:45 +0000
commit6f267f022f4a1cc47b3b3607f193637262ee69e6 (patch)
treecf89e32bf990da7bfdab99e1b96f2b61213764bc
parent01f67987e0aa4a4890a02d1a7445d878d3436d26 (diff)
downloadbusybox-6f267f022f4a1cc47b3b3607f193637262ee69e6.tar.gz
applying fix for:
0000261: Unsafe empty env var export in ash
-rw-r--r--shell/ash.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 045d659ed..8656c0219 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12001,9 +12001,8 @@ setvar(const char *name, const char *val, int flags)
}
INTOFF;
p = mempcpy(nameeq = ckmalloc(namelen + vallen + 2), name, namelen);
- *p++ = '\0';
+ *p++ = '=';
if (vallen) {
- p[-1] = '=';
p = mempcpy(p, val, vallen);
}
*p = '\0';