aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-11-19 11:34:03 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-11-19 11:34:03 +0000
commitff7c63b24d8e20fa4c75e408a5d29c44b154819f (patch)
tree27b916ae7e2ba71e665a85bb441cb91fb4d9c7bf /src/libutil/str_util.c
parent550c1905fe920aa857550317edd8e2961f087978 (diff)
downloadrspamd-ff7c63b24d8e20fa4c75e408a5d29c44b154819f.tar.gz
rspamd-ff7c63b24d8e20fa4c75e408a5d29c44b154819f.zip
[Minor] Fix some more lua compat issues with text:find
Diffstat (limited to 'src/libutil/str_util.c')
-rw-r--r--src/libutil/str_util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index 80f94707a..1e7d0b06b 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -1891,6 +1891,9 @@ rspamd_substring_search (const gchar *in, gsize inlen,
return (-1);
}
+ else if (G_UNLIKELY (srchlen == 0)) {
+ return 0;
+ }
return rspamd_substring_search_common (in, inlen, srch, srchlen,
rspamd_substring_cmp_func);