aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-01-27 16:31:16 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-01-27 16:31:16 +0000
commita4d2691a85bfa567cc9afe2b97fe2ae4a04a2fde (patch)
tree95a2113e0617441a9cfb957b82a5f4ffdeb80d7b
parent4442930ade090c47aacdaceaf4fffb83f392e018 (diff)
downloadrspamd-a4d2691a85bfa567cc9afe2b97fe2ae4a04a2fde.tar.gz
rspamd-a4d2691a85bfa567cc9afe2b97fe2ae4a04a2fde.zip
[Fix] Fix regexp type check for pcre2
-rw-r--r--src/libutil/regexp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c
index f36bd04f9..b91ab819e 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