From aec4aac98ff636dbbfabcc8f3e61c40fd1532283 Mon Sep 17 00:00:00 2001 From: gio Date: Thu, 30 Jul 2015 06:27:41 +0000 Subject: [PATCH] Fixed possible stack overflow with special crafted input discovered by bonsaiviking with fuzzing --- nmap_dns.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nmap_dns.cc b/nmap_dns.cc index 1d67f3c6c..6ec162f0c 100644 --- a/nmap_dns.cc +++ b/nmap_dns.cc @@ -1514,7 +1514,7 @@ size_t DNS::Factory::parseDomainName(std::string &name, const char *buf, size_t u16 real_offset; DNS_CHECK_ACCUMLATE(ret, tmp, parseUnsignedShort(real_offset, buf, offset+ret, maxlen)); real_offset -= COMPRESSED_NAME<<8; - if( real_offset < maxlen) + if( real_offset < offset) { std::string val; DNS_CHECK_ACCUMLATE(tmp, tmp, parseDomainName(val, buf, real_offset, maxlen));