Issue: #4885
Closes: #4885
if (max_hits > 0 && r >= max_hits) {
break;
}
+
+ if (start >= end) {
+ /* We found all matches, so no more hits are possible (protect from empty patterns) */
+ break;
+ }
}
rt->results[id] += r;
&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;
}
}
matched = TRUE;
+
+ if (start >= end) {
+ /* We found all matches, so no more hits are possible (protect from empty patterns) */
+ break;
+ }
}
if (!matched) {
lua_rawseti(L, -2, ++i);
matched = TRUE;
}
- else if (start == end) {
+ else if (start >= end) {
break;
}
old_start = end;