diff options
author | Ron Yorston <rmy@pobox.com> | 2014-01-10 20:13:40 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2014-01-10 20:13:40 +0000 |
commit | 3eff46194e1879b27017df5fb18862289c07f57c (patch) | |
tree | 0287dca82defedd5486b6f0fea3da6be922425e3 /shell | |
parent | 8e822ba8c86618a582460c56006d352b3b7e0d26 (diff) | |
download | busybox-w32-3eff46194e1879b27017df5fb18862289c07f57c.tar.gz busybox-w32-3eff46194e1879b27017df5fb18862289c07f57c.tar.bz2 busybox-w32-3eff46194e1879b27017df5fb18862289c07f57c.zip |
ash: prevent null-pointer exception with local variables
A local variable can have a null text pointer: if so, don't call
strlen. localvar_copy handles this correctly because nodeckstrdup
doesn't try to copy from the null pointer.
Diffstat (limited to 'shell')
-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 be72e84f6..9678e8092 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -14035,7 +14035,7 @@ SLIST_COPY_END() | |||
14035 | */ | 14035 | */ |
14036 | SLIST_SIZE_BEGIN(localvar_size,struct localvar) | 14036 | SLIST_SIZE_BEGIN(localvar_size,struct localvar) |
14037 | var_size(p->vp); | 14037 | var_size(p->vp); |
14038 | funcstringsize += strlen(p->text) + 1; | 14038 | if (p->text) funcstringsize += strlen(p->text) + 1; |
14039 | nodeptrsize += 2; /* p->vp, p->text */ | 14039 | nodeptrsize += 2; /* p->vp, p->text */ |
14040 | SLIST_SIZE_END() | 14040 | SLIST_SIZE_END() |
14041 | 14041 | ||