diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-07-05 10:17:28 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-07-05 10:17:28 +0200 |
commit | e0e3f9fdeecc438489c06eb72e7afe91de3c7102 (patch) | |
tree | e21d7a0ad3fa4720d0d936d8a1c642e5c7cc7914 /src/core | |
parent | afa81c4594a887c048be73d12cf07e569c8a9b69 (diff) | |
download | weechat-e0e3f9fdeecc438489c06eb72e7afe91de3c7102.zip |
core: check that regex is not NULL in function string_regcomp
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 5becd6409..d4b3175ea 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -922,6 +922,9 @@ string_regcomp (void *preg, const char *regex, int default_flags) const char *ptr_regex; int flags; + if (!regex) + return -1; + ptr_regex = string_regex_flags (regex, default_flags, &flags); return regcomp ((regex_t *)preg, ptr_regex, flags); } |