From: Vsevolod Stakhov Date: Mon, 19 Jul 2010 14:01:36 +0000 (+0400) Subject: * Do not try to resolve names with several dots in a row X-Git-Tag: 0.3.1~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f5bc6840a7db6034eeec338454105814fabbfb32;p=rspamd.git * Do not try to resolve names with several dots in a row * Fix surbl request formatting for ip addresses --- diff --git a/src/dns.c b/src/dns.c index a0b9b36aa..7e4f56972 100644 --- a/src/dns.c +++ b/src/dns.c @@ -371,6 +371,12 @@ format_dns_name (struct rspamd_dns_request *req, const char *name, guint namelen label_len = remain - 1; msg_err ("no buffer remain for constructing query, strip to %ud", label_len); } + if (label_len == 0) { + /* Two dots in order, skip this */ + msg_info ("name contains two or more dots in a row, replace it with one dot"); + begin = dot + 1; + continue; + } /* First try to compress name */ if (! try_compress_label (req->pool, pos, req->packet, end - begin, begin, table)) { *pos++ = (guint8)label_len; diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 09c382b7f..2fbeb5e2b 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -347,9 +347,9 @@ format_surbl_request (memory_pool_t * pool, f_str_t * hostname, struct suffix_it (int)(hostname->len - (dots[2] - hostname->begin + 1)), dots[2] + 1, (int)(dots[2] - dots[1] - 1), - dots[1], + dots[1] + 1, (int)(dots[1] - dots[0] - 1), - dots[0], + dots[0] + 1, (int)(dots[0] - hostname->begin), hostname->begin); }