aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-19 13:32:09 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-19 13:32:09 +0100
commit90cc2d3b54b7cf6253d9cc467f4a540005a6fa5d (patch)
treeb9310495365ce5538b176cfad51513b7467404a9 /src/libutil
parentad27793a84f0fbba21b8bed53348358ef755165c (diff)
downloadrspamd-90cc2d3b54b7cf6253d9cc467f4a540005a6fa5d.tar.gz
rspamd-90cc2d3b54b7cf6253d9cc467f4a540005a6fa5d.zip
Fix critical bug on matching regular expressions.
Issue: #186 Reported by: @moisseev
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/regexp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c
index 15d83dd44..6bcdea67d 100644
--- a/src/libutil/regexp.c
+++ b/src/libutil/regexp.c
@@ -177,6 +177,7 @@ rspamd_regexp_new (const gchar *pattern, const gchar *flags,
}
rspamd_flags |= RSPAMD_REGEXP_FLAG_RAW;
+ regexp_flags |= PCRE_NO_AUTO_CAPTURE;
regexp_flags &= ~PCRE_UTF8;
if (flags_str != NULL) {
@@ -421,7 +422,7 @@ rspamd_regexp_search (rspamd_regexp_t *re, const gchar *text, gsize len,
rc = pcre_exec (r, ext, mt, remain, 0, match_flags, ovec,
G_N_ELEMENTS (ovec));
}
- if (rc > 0) {
+ if (rc >= 0) {
if (start) {
*start = mt + ovec[0];
}