From: Vsevolod Stakhov Date: Mon, 27 Jan 2020 16:31:16 +0000 (+0000) Subject: [Fix] Fix regexp type check for pcre2 X-Git-Tag: 2.3~38 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4d2691a85bfa567cc9afe2b97fe2ae4a04a2fde;p=thirdparty%2Frspamd.git [Fix] Fix regexp type check for pcre2 --- diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c index f36bd04f99..b91ab819e6 100644 --- a/src/libutil/regexp.c +++ b/src/libutil/regexp.c @@ -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