core: check that string is not NULL in function string_strndup

v2.8-utf8proc
Sébastien Helleu 2014-07-04 07:41:20 +02:00
parent 494d046594
commit e702722842
1 changed files with 3 additions and 0 deletions

View File

@ -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);