commit 8cff3d6: [Fix] Slashing fix: fix captures matching API

Vsevolod Stakhov vsevolod at highsecure.ru
Thu May 14 12:21:23 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-05-14 13:15:24 +0100
URL: https://github.com/rspamd/rspamd/commit/8cff3d6084888649180394336281405062d2fadd

[Fix] Slashing fix: fix captures matching API

---
 src/libutil/regexp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c
index 0216c95e8..396da80d1 100644
--- a/src/libutil/regexp.c
+++ b/src/libutil/regexp.c
@@ -632,7 +632,7 @@ rspamd_regexp_search (rspamd_regexp_t *re, const gchar *text, gsize len,
 			*end = mt + ovec[1];
 		}
 
-		if (captures != NULL && rc > 1) {
+		if (captures != NULL && rc >= 1) {
 			struct rspamd_re_capture *elt;
 
 			g_assert (g_array_get_element_size (captures) ==
@@ -746,7 +746,7 @@ rspamd_regexp_search (rspamd_regexp_t *re, const gchar *text, gsize len,
 			*end = mt + ovec[1];
 		}
 
-		if (captures != NULL && novec > 1) {
+		if (captures != NULL && novec >= 1) {
 			struct rspamd_re_capture *elt;
 
 			g_assert (g_array_get_element_size (captures) ==


More information about the Commits mailing list