summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2014-07-05 10:15:29 +0200
committerSébastien Helleu <flashcode@flashtux.org>2014-07-05 10:15:29 +0200
commitafa81c4594a887c048be73d12cf07e569c8a9b69 (patch)
tree6904c2d9d1146830f2e7e7f67a34a7a60ac50ced
parentd936880392be82f298fcc7a5bd5d833b4958e2d1 (diff)
downloadweechat-afa81c4594a887c048be73d12cf07e569c8a9b69.zip
core: check that regex is not NULL in function string_regex_flags
-rw-r--r--src/core/wee-string.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/wee-string.c b/src/core/wee-string.c
index 13168b312..5becd6409 100644
--- a/src/core/wee-string.c
+++ b/src/core/wee-string.c
@@ -854,10 +854,13 @@ string_regex_flags (const char *regex, int default_flags, int *flags)
int set_flag, flag;
char *pos;
- ptr_regex = regex;
if (flags)
*flags = default_flags;
+ if (!regex)
+ return NULL;
+
+ ptr_regex = regex;
while (strncmp (ptr_regex, "(?", 2) == 0)
{
pos = strchr (ptr_regex, ')');