From e702722842ec0958b986971270af5e08687f2eb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 4 Jul 2014 07:41:20 +0200 Subject: core: check that string is not NULL in function string_strndup --- src/core/wee-string.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/core/wee-string.c b/src/core/wee-string.c index 21a1fca4d..efc13b6cf 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -74,6 +74,9 @@ string_strndup (const char *string, int length) { char *result; + if (!string) + return NULL; + if ((int)strlen (string) < length) return strdup (string); -- cgit v1.2.3