From 734034db2f98ae71cc7b53ad4d8d56b295a72a0b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 15 Jan 2016 17:20:23 +0000 Subject: [PATCH] Fix bad memory access. --- src/libserver/dkim.c | 4 ++-- 1 file 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++; -- 2.39.5