diff options
Diffstat (limited to 'src/libutil/regexp.c')
-rw-r--r-- | src/libutil/regexp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c index f0f16f423..a3246ae9f 100644 --- a/src/libutil/regexp.c +++ b/src/libutil/regexp.c @@ -570,7 +570,11 @@ rspamd_regexp_search (rspamd_regexp_t *re, const gchar *text, gsize len, #endif } - g_assert (r != NULL); + if (r == NULL) { + /* Invalid regexp type for the specified input */ + return FALSE; + } + ncaptures = (re->ncaptures + 1) * 3; ovec = g_alloca (sizeof (gint) * ncaptures); |