From 3eff46194e1879b27017df5fb18862289c07f57c Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Fri, 10 Jan 2014 20:13:40 +0000 Subject: 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. --- shell/ash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shell') 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() */ SLIST_SIZE_BEGIN(localvar_size,struct localvar) var_size(p->vp); -funcstringsize += strlen(p->text) + 1; +if (p->text) funcstringsize += strlen(p->text) + 1; nodeptrsize += 2; /* p->vp, p->text */ SLIST_SIZE_END() -- cgit v1.2.3-55-g6feb