From 631741e28256b05f3291e92197aad749993c2b9c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 2 Jun 2011 20:55:19 +0400 Subject: [PATCH] Fix bug in librsapmdclient with uninitialized struct field. Fix bug in DNS parser that caused invalid parsing of CNAME fields. --- lib/librspamdclient.c | 1 + src/dns.c | 6 ++++++ 2 files changed, 7 insertions(+) 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; -- 2.39.5