From: Vsevolod Stakhov Date: Thu, 2 Jun 2011 16:55:19 +0000 (+0400) Subject: Fix bug in librsapmdclient with uninitialized struct field. X-Git-Tag: 0.3.13~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=631741e28256b05f3291e92197aad749993c2b9c;p=rspamd.git Fix bug in librsapmdclient with uninitialized struct field. Fix bug in DNS parser that caused invalid parsing of CNAME fields. --- diff --git a/lib/librspamdclient.c b/lib/librspamdclient.c index 0c624e2e2..92c513cdc 100644 --- a/lib/librspamdclient.c +++ b/lib/librspamdclient.c @@ -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: diff --git a/src/dns.c b/src/dns.c index ad308c615..71feeee17 100644 --- 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;