From 64ab89438d39b9ffa30f6b5fb1867b0fb11f28f1 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy --- 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 0ee72dcd3..137d8edde 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