]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix substring search in case if srchlen == inlen
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 18 Nov 2020 17:47:33 +0000 (17:47 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 18 Nov 2020 17:47:33 +0000 (17:47 +0000)
src/libutil/str_util.c

index a67a1f378261c3b2b20d2fbb53d502517d4c0ec4..80f94707a3858a7dfed4df9830585ed74f21fb35 100644 (file)
@@ -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);