mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 01:03:14 +02:00
core: check that string is not NULL in function string_strndup
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user