]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix oob read
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 25 Mar 2021 10:23:37 +0000 (10:23 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 25 Mar 2021 10:23:37 +0000 (10:23 +0000)
src/libmime/message.c

index 99b84e38585ced1be78fb8576e17bc0af31d30cb..8a9601fa771de8d5499864b87eeadc18c4beb267 100644 (file)
@@ -467,7 +467,7 @@ rspamd_strip_newlines_parse (struct rspamd_task *task,
                                if (G_UNLIKELY (*c) == ' ') {
                                        part->spaces ++;
 
-                                       if (*(c - 1) == ' ') {
+                                       if (c > begin && *(c - 1) == ' ') {
                                                part->double_spaces ++;
                                        }
                                }