summaryrefslogtreecommitdiffstats
path: root/src/dns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dns.c')
-rw-r--r--src/dns.c6
1 files changed, 6 insertions, 0 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;