diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-07-04 07:41:20 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-07-04 07:41:20 +0200 |
commit | e702722842ec0958b986971270af5e08687f2eb8 (patch) | |
tree | 724dcc62226a3abd48ec067490c083090d3bd8e6 /src/core | |
parent | 494d04659417b1c302d1dd6d8c9a36aa4f9f0810 (diff) | |
download | weechat-e702722842ec0958b986971270af5e08687f2eb8.zip |
core: check that string is not NULL in function string_strndup
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-string.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); |