]> granicus.if.org Git - pdns/commitdiff
oops - exception could escape, which could make the pdns_recursor keel over
authorBert Hubert <bert.hubert@netherlabs.nl>
Mon, 31 Oct 2005 18:07:49 +0000 (18:07 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Mon, 31 Oct 2005 18:07:49 +0000 (18:07 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@532 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/dnsparser.cc

index 5c337a4c3dd2f0582016b3500c35ade918b076f5..4a098052ca946ddc1a5f40b75e1d38a8d139751c 100644 (file)
@@ -168,13 +168,13 @@ void MOADNSParser::init(const char *packet, unsigned int len)
 
   PacketReader pr(d_content);
 
-  for(n=0;n < d_header.qdcount; ++n) {
-    d_qname=pr.getLabel();
-    d_qtype=pr.get16BitInt();
-    d_qclass=pr.get16BitInt();
-  }
-
   try {
+    for(n=0;n < d_header.qdcount; ++n) {
+      d_qname=pr.getLabel();
+      d_qtype=pr.get16BitInt();
+      d_qclass=pr.get16BitInt();
+    }
+
     struct dnsrecordheader ah;
     vector<unsigned char> record;