From f5bc6840a7db6034eeec338454105814fabbfb32 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 19 Jul 2010 18:01:36 +0400 Subject: [PATCH] * Do not try to resolve names with several dots in a row * Fix surbl request formatting for ip addresses --- src/dns.c | 6 ++++++ src/plugins/surbl.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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); } -- 2.39.5