From d6de1382a4e2c0ff723f1ee65c8e64c81fb0a76c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 18 Nov 2020 17:47:33 +0000 Subject: [Fix] Fix substring search in case if srchlen == inlen --- src/libutil/str_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index a67a1f378..80f94707a 100644 --- a/src/libutil/str_util.c +++ b/src/libutil/str_util.c @@ -1896,7 +1896,7 @@ rspamd_substring_search (const gchar *in, gsize inlen, rspamd_substring_cmp_func); } else if (inlen == srchlen) { - return rspamd_lc_cmp (srch, in, srchlen) == 0; + return (rspamd_lc_cmp (srch, in, srchlen) == 0 ? 0 : -1); } else { return (-1); -- cgit v1.2.3