]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix regexp type check for pcre2
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 27 Jan 2020 16:31:16 +0000 (16:31 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 27 Jan 2020 16:31:16 +0000 (16:31 +0000)
src/libutil/regexp.c

index f36bd04f99fd19285af5835992f8749329c58edd..b91ab819e6e613abf670ba831db0b1bf30dc340c 100644 (file)
@@ -708,6 +708,11 @@ rspamd_regexp_search (rspamd_regexp_t *re, const gchar *text, gsize len,
                mcontext = re->mcontext;
        }
 
+       if (r == NULL) {
+               /* Invalid regexp type for the specified input */
+               return FALSE;
+       }
+
        match_data = pcre2_match_data_create (re->ncaptures + 1, NULL);
 
 #ifdef HAVE_PCRE_JIT