From 40f78f44fe2fa52698be992ed3a8c0cf5429f8d6 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 14 Apr 2010 00:40:59 +0200 Subject: win32: ash: nodeckstrdup(): tolerate NULL string --- shell/ash.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index 181357c1c..d4b60f081 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -8144,10 +8144,12 @@ calcsize(union node *n) } static char * -nodeckstrdup(char *s) +nodeckstrdup(const char *s) { char *rtn = funcstring; + if (!s) + return NULL; strcpy(funcstring, s); funcstring += strlen(s) + 1; return rtn; -- cgit v1.2.3-55-g6feb