diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-03-22 17:07:58 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-03-22 17:07:58 +0000 |
commit | 2038f3c92afaaeceab3e7107a38c06f8d555ae53 (patch) | |
tree | 707f8ed7a9cde54f0466772ac90270cbedee6f7d /src/libutil | |
parent | 05636d9af847923a6f1e538897b085cb3dcdf5d0 (diff) | |
download | rspamd-2038f3c92afaaeceab3e7107a38c06f8d555ae53.tar.gz rspamd-2038f3c92afaaeceab3e7107a38c06f8d555ae53.zip |
[CritFix] Protect regexp matcher from regexps with empty patterns
Issue: #4885
Closes: #4885
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/multipattern.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c index 3c9be0df3..9ae798bb9 100644 --- a/src/libutil/multipattern.c +++ b/src/libutil/multipattern.c @@ -717,6 +717,10 @@ int rspamd_multipattern_lookup(struct rspamd_multipattern *mp, &end, TRUE, NULL)) { + if (start >= end) { + /* We found all matches, so no more hits are possible (protect from empty patterns) */ + break; + } if (rspamd_multipattern_acism_cb(i, end - in, &cbd)) { goto out; } |