From: Vsevolod Stakhov Date: Sat, 17 Jul 2021 09:07:14 +0000 (+0100) Subject: [Minor] Fix another extreme case X-Git-Tag: 3.0~139 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=66d8ff3b6b07343c31dc66c2db8720c912302bf0;p=rspamd.git [Minor] Fix another extreme case --- diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c index 700b595c1..584c0c5c9 100644 --- a/src/libutil/regexp.c +++ b/src/libutil/regexp.c @@ -309,7 +309,7 @@ rspamd_regexp_t* rspamd_regexp_new_len (const gchar *pattern, gsize len, const gchar *flags, GError **err) { - const gchar *start = pattern, *end = start + len, *flags_str = NULL, *flags_end; + const gchar *start = pattern, *end = start + len, *flags_str = NULL, *flags_end = NULL; gchar *err_str; rspamd_regexp_t *res; gboolean explicit_utf = FALSE; @@ -372,7 +372,9 @@ rspamd_regexp_new_len (const gchar *pattern, gsize len, const gchar *flags, strict_flags = TRUE; start = pattern; flags_str = flags; - flags_end = flags + strlen(flags); + if (flags) { + flags_end = flags + strlen(flags); + } } rspamd_flags |= RSPAMD_REGEXP_FLAG_RAW;