From: Vsevolod Stakhov Date: Fri, 15 Jan 2016 17:20:23 +0000 (+0000) Subject: Fix bad memory access. X-Git-Tag: 1.1.0~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=734034db2f98ae71cc7b53ad4d8d56b295a72a0b;p=rspamd.git Fix bad memory access. --- 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++;