commit d6de138: [Fix] Fix substring search in case if srchlen == inlen
Vsevolod Stakhov
vsevolod at highsecure.ru
Wed Nov 18 17:56:07 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-11-18 17:47:33 +0000
URL: https://github.com/rspamd/rspamd/commit/d6de1382a4e2c0ff723f1ee65c8e64c81fb0a76c
[Fix] Fix substring search in case if srchlen == inlen
---
src/libutil/str_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
More information about the Commits
mailing list