]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Check the packet size in dnspcap2protobuf
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 24 Mar 2016 15:14:00 +0000 (16:14 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Fri, 25 Mar 2016 19:11:03 +0000 (20:11 +0100)
pdns/dnspcap2protobuf.cc

index 448dcfb78a0a7cd882e56a152204286e73b8c773..2b7698a8aa89c301579f67afef2f169f6ec4dd13 100644 (file)
@@ -89,6 +89,9 @@ int main(int argc, char **argv)
     if (!dh->qdcount)
       continue;
 
+    if (pr.d_len < sizeof(dnsheader))
+      continue;
+
     uint16_t qtype, qclass;
     DNSName qname;
     try {