From b506d1b725ad9a492c896b0394b033fbd957aaa5 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 15 Aug 2019 15:49:03 +0100 Subject: [PATCH] [Minor] Allow 0 length in rspamd_regexp_match --- src/libutil/regexp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c index 8b35ea395..fa606273c 100644 --- a/src/libutil/regexp.c +++ b/src/libutil/regexp.c @@ -863,6 +863,10 @@ rspamd_regexp_match (rspamd_regexp_t *re, const gchar *text, gsize len, g_assert (re != NULL); g_assert (text != NULL); + if (len == 0 && text != NULL) { + len = strlen (text); + } + if (rspamd_regexp_search (re, text, len, &start, &end, raw, NULL)) { if (start == text && end == text + len) { return TRUE; -- 2.39.5