aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2014-01-10 20:13:40 +0000
committerRon Yorston <rmy@pobox.com>2014-01-10 20:13:40 +0000
commit3eff46194e1879b27017df5fb18862289c07f57c (patch)
tree0287dca82defedd5486b6f0fea3da6be922425e3 /shell
parent8e822ba8c86618a582460c56006d352b3b7e0d26 (diff)
downloadbusybox-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.c2
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 */
14036SLIST_SIZE_BEGIN(localvar_size,struct localvar) 14036SLIST_SIZE_BEGIN(localvar_size,struct localvar)
14037var_size(p->vp); 14037var_size(p->vp);
14038funcstringsize += strlen(p->text) + 1; 14038if (p->text) funcstringsize += strlen(p->text) + 1;
14039nodeptrsize += 2; /* p->vp, p->text */ 14039nodeptrsize += 2; /* p->vp, p->text */
14040SLIST_SIZE_END() 14040SLIST_SIZE_END()
14041 14041