diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-15 15:49:03 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-15 15:49:03 +0100 |
commit | b506d1b725ad9a492c896b0394b033fbd957aaa5 (patch) | |
tree | 4e903b02b19a9867d025030fb20518b5ad557f1b /src/libutil/regexp.c | |
parent | 327be8edbaed1194d5fa3caefedab7d45f740dfe (diff) | |
download | rspamd-b506d1b725ad9a492c896b0394b033fbd957aaa5.tar.gz rspamd-b506d1b725ad9a492c896b0394b033fbd957aaa5.zip |
[Minor] Allow 0 length in rspamd_regexp_match
Diffstat (limited to 'src/libutil/regexp.c')
-rw-r--r-- | src/libutil/regexp.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |