From 0db0e0c2163395949d878e689f62e3fc804c0090 Mon Sep 17 00:00:00 2001 From: Giovanni Bajo Date: Wed, 2 May 2012 00:16:08 +0200 Subject: [PATCH] Fix a bug in rdlen update while decompressing a name --- src/dnssec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dnssec.c b/src/dnssec.c index 6bb7a05..6cf115c 100644 --- a/src/dnssec.c +++ b/src/dnssec.c @@ -141,8 +141,10 @@ static int process_domain_name(struct dns_header *header, size_t pktlen, label_type = count & 0xC0; if (label_type == 0xC0) { + int l2; if (p >= end) return 0; + l2 = *p++; if (hops == 0) { if (p - *rdata > *rdlen) @@ -152,7 +154,7 @@ static int process_domain_name(struct dns_header *header, size_t pktlen, } if (++hops == 256) return 0; - p = (unsigned char*)header + (count & 0x3F) * 256 + *p; + p = (unsigned char*)header + (count & 0x3F) * 256 + l2; } else if (label_type == 0x00) {