From: Vsevolod Stakhov Date: Thu, 7 Jun 2018 10:29:28 +0000 (+0100) Subject: [Minor] Do not read out of the bounds X-Git-Tag: 1.7.6~46 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=22fa0421cdaed8bf4e151777fd8fc1c09487fa44;p=rspamd.git [Minor] Do not read out of the bounds --- diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index 7c2a545c0..026e331fe 100644 --- a/src/libutil/str_util.c +++ b/src/libutil/str_util.c @@ -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 {