aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-15 17:20:23 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-15 17:20:23 +0000
commit734034db2f98ae71cc7b53ad4d8d56b295a72a0b (patch)
tree9d022e15cd6a765efa2d2198d610be5c5c4799f8
parentdbd123b42751f998096d0121f2079f97236c1a55 (diff)
downloadrspamd-734034db2f98ae71cc7b53ad4d8d56b295a72a0b.tar.gz
rspamd-734034db2f98ae71cc7b53ad4d8d56b295a72a0b.zip
Fix bad memory access.
-rw-r--r--src/libserver/dkim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c
index d1542c1a0..d0691d80b 100644
--- a/src/libserver/dkim.c
+++ b/src/libserver/dkim.c
@@ -308,7 +308,7 @@ rspamd_dkim_parse_hdrlist (rspamd_dkim_context_t * ctx,
p = param;
while (p <= end) {
- if ((*p == ':' || p == end)) {
+ if ((p == end || *p == ':')) {
count++;
}
p++;
@@ -324,7 +324,7 @@ rspamd_dkim_parse_hdrlist (rspamd_dkim_context_t * ctx,
c = param;
p = param;
while (p <= end) {
- if ((*p == ':' || p == end) && p - c > 0) {
+ if ((p == end || *p == ':') && p - c > 0) {
if ((new =
rspamd_dkim_find_header (ctx->hlist, c, p - c)) != NULL) {
new->count++;