]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not read out of the bounds
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 Jun 2018 10:29:28 +0000 (11:29 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 Jun 2018 10:29:28 +0000 (11:29 +0100)
src/libutil/str_util.c

index 7c2a545c07bbcc3cd1ff9bb432eaae83ca6958f2..026e331feae5b15fbc0f1a8f29b60576031f8d2a 100644 (file)
@@ -1261,7 +1261,7 @@ rspamd_substring_preprocess_kmp (const gchar *pat, gsize len, goffset *fsm,
                i++;
                j++;
 
-               if (f(pat[i], pat[j])) {
+               if (i < len && j < len && f(pat[i], pat[j])) {
                        fsm[i] = fsm[j];
                }
                else {