diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-14 13:22:52 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-14 13:22:52 +0100 |
commit | 5d2a065cb612192779b30a030a9e4b5a6e87eb93 (patch) | |
tree | dcd415760858e3afd009240a663b1ed354d869f3 /src/libmime/message.c | |
parent | c2207e714289caf8a0999bbd67d9a4b58b019065 (diff) | |
download | rspamd-5d2a065cb612192779b30a030a9e4b5a6e87eb93.tar.gz rspamd-5d2a065cb612192779b30a030a9e4b5a6e87eb93.zip |
[Minor] Avoid out of boundary reads
Diffstat (limited to 'src/libmime/message.c')
-rw-r--r-- | src/libmime/message.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c index ce53c15f9..4381302fa 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -454,7 +454,7 @@ rspamd_strip_newlines_parse (const gchar *begin, const gchar *pe, if (G_UNLIKELY (*p) == ' ') { part->spaces ++; - if (*(p - 1) == ' ') { + if (p > begin && *(p - 1) == ' ') { part->double_spaces ++; } } @@ -524,7 +524,7 @@ rspamd_strip_newlines_parse (const gchar *begin, const gchar *pe, else { part->non_spaces ++; - if (G_UNLIKELY (*p & 0x80)) { + if (G_UNLIKELY (*c & 0x80)) { part->non_ascii_chars ++; } else { |