diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-29 09:35:35 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-29 09:35:35 +0000 |
commit | a84ac65a88a1a2bde444be3b3e982309bee4bcb7 (patch) | |
tree | edd8bfa3e5a19828a8575c55ad31406fdb72fa4d /src/libutil | |
parent | 2f69ba4a877b29676819d7dc7be90f47384faef0 (diff) | |
download | rspamd-a84ac65a88a1a2bde444be3b3e982309bee4bcb7.tar.gz rspamd-a84ac65a88a1a2bde444be3b3e982309bee4bcb7.zip |
Allow keyword searching
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/str_util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index faa33dc8f..8487e8ef2 100644 --- a/src/libutil/str_util.c +++ b/src/libutil/str_util.c @@ -1088,6 +1088,10 @@ rspamd_substring_search (const gchar *in, gsize inlen, gint d, hash_srch, hash_in; gsize i, j; + if (inlen < srchlen) { + return -1; + } + /* Preprocessing */ for (d = i = 1; i < srchlen; ++i) { /* computes d = 2^(m-1) with the left-shift operator */ |