From: Remi Gacogne Date: Thu, 24 Mar 2016 15:14:00 +0000 (+0100) Subject: Check the packet size in dnspcap2protobuf X-Git-Tag: dnsdist-1.0.0-beta1~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c2862d4ef21186ddc6e69466e88d3c7cee7b55e;p=thirdparty%2Fpdns.git Check the packet size in dnspcap2protobuf --- diff --git a/pdns/dnspcap2protobuf.cc b/pdns/dnspcap2protobuf.cc index 448dcfb78a..2b7698a8aa 100644 --- a/pdns/dnspcap2protobuf.cc +++ b/pdns/dnspcap2protobuf.cc @@ -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 {