core: check that string is not NULL in function string_strndup
parent
494d046594
commit
e702722842
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue