]> source.dussan.org Git - rspamd.git/commitdiff
Fix bad memory access.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Jan 2016 17:20:23 +0000 (17:20 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 15 Jan 2016 17:20:23 +0000 (17:20 +0000)
src/libserver/dkim.c

index d1542c1a078eb2d31c4fb201a4ad414a69aa3674..d0691d80bdbbedf488679b606760a5b7159e0bf9 100644 (file)
@@ -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++;