]> source.dussan.org Git - rspamd.git/commitdiff
Fix bug in librsapmdclient with uninitialized struct field.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 2 Jun 2011 16:55:19 +0000 (20:55 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 2 Jun 2011 16:55:19 +0000 (20:55 +0400)
Fix bug in DNS parser that caused invalid parsing of CNAME fields.

lib/librspamdclient.c
src/dns.c

index 0c624e2e2f24834bbf51dd99386c8caadb15c895..92c513cdcc5ca38bf1b5da44eb2a0e60ef2c5319 100644 (file)
@@ -275,6 +275,7 @@ rspamd_connect_random_server (gboolean is_control, GError **err)
        }
 
        new->in_buf = g_string_sized_new (BUFSIZ);
+       new->cur_metric = NULL;
        return new;
 
 err:
index ad308c615cd5bb69720bd42ef03d4dfc4de83f10..71feeee1765ac7031eb625fbcddc6a72831533b7 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -889,8 +889,14 @@ dns_parse_rr (guint8 *in, union rspamd_reply_element *elt, guint8 **pos, struct
                        parsed = TRUE;
                }
                break;
+       case DNS_T_CNAME:
+               /* Skip cname records */
+               p += datalen;
+               break;
        default:
                msg_debug ("unexpected RR type: %d", type);
+               p += datalen;
+               break;
        }
        *remain -= datalen;
        *pos = p;