From afa81c4594a887c048be73d12cf07e569c8a9b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 5 Jul 2014 10:15:29 +0200 Subject: core: check that regex is not NULL in function string_regex_flags --- src/core/wee-string.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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, ')'); -- cgit v1.2.3