diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-17 10:07:14 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-17 10:07:14 +0100 |
commit | 66d8ff3b6b07343c31dc66c2db8720c912302bf0 (patch) | |
tree | f5f90205bcc6de077db1a9d5ea88fb63f6503da3 | |
parent | 76e216dd05fdb02001f0107b54cff92a694a1e16 (diff) | |
download | rspamd-66d8ff3b6b07343c31dc66c2db8720c912302bf0.tar.gz rspamd-66d8ff3b6b07343c31dc66c2db8720c912302bf0.zip |
[Minor] Fix another extreme case
-rw-r--r-- | src/libutil/regexp.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |