From 22fa0421cdaed8bf4e151777fd8fc1c09487fa44 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 7 Jun 2018 11:29:28 +0100 Subject: [PATCH] [Minor] Do not read out of the bounds --- 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 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 { -- 2.39.5