We no longer do explicit checks in low-level routines for running past
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 19 Jan 2002 23:59:03 +0000 (23:59 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 19 Jan 2002 23:59:03 +0000 (23:59 +0000)
the end of the data in the packet, so we don't need to do those checks
in the callers of those routines - and thus don't need to do those
checks in the callers of *those* routines.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4574 f5534014-38df-0310-8fa8-9805f1628bb7

packet-dns.c
packet-nbns.c

index 3552897697db092d8843639395050422a2d51589..278b599718aebc8716dba545cca69e5b59a46db3 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-dns.c
  * Routines for DNS packet disassembly
  *
- * $Id: packet-dns.c,v 1.77 2001/12/10 00:25:27 guy Exp $
+ * $Id: packet-dns.c,v 1.78 2002/01/19 23:59:02 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -638,10 +638,6 @@ dissect_dns_query(tvbuff_t *tvb, int offset, int dns_data_offset,
 
   len = get_dns_name_type_class(tvb, offset, dns_data_offset, name, &name_len,
     &type, &class);
-  if (len < 0) {
-    /* We ran past the end of the data in the packet. */
-    return 0;
-  }
   data_offset += len;
 
   type_name = dns_type_name(type);
@@ -1724,10 +1720,6 @@ dissect_query_records(tvbuff_t *tvb, int cur_off, int dns_data_offset,
   }
   while (count-- > 0) {
     add_off = dissect_dns_query(tvb, cur_off, dns_data_offset, cinfo, qatree);
-    if (add_off <= 0) {
-      /* We ran past the end of the captured data in the packet. */
-      break;
-    }
     cur_off += add_off;
   }
   if (ti)
@@ -1751,10 +1743,6 @@ dissect_answer_records(tvbuff_t *tvb, int cur_off, int dns_data_offset,
   }
   while (count-- > 0) {
     add_off = dissect_dns_answer(tvb, cur_off, dns_data_offset, cinfo, qatree);
-    if (add_off <= 0) {
-      /* We ran past the end of the captured data in the packet. */
-      break;
-    }
     cur_off += add_off;
   }
   if (ti)
index 7f19b6c7bee9a3bd1737a7221f7eb36e507b5165..76046a7bb8ca4fb0b29a9d9b48db012b9656d314 100644 (file)
@@ -3,7 +3,7 @@
  * to when it had only NBNS)
  * Guy Harris <guy@alum.mit.edu>
  *
- * $Id: packet-nbns.c,v 1.69 2002/01/07 00:57:46 guy Exp $
+ * $Id: packet-nbns.c,v 1.70 2002/01/19 23:59:03 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -933,11 +933,6 @@ dissect_query_records(tvbuff_t *tvb, int cur_off, int nbns_data_offset,
        while (count-- > 0) {
                add_off = dissect_nbns_query(tvb, cur_off, nbns_data_offset,
                    cinfo, qatree);
-               if (add_off <= 0) {
-                       /* We ran past the end of the captured data in the
-                          packet. */
-                       break;
-               }
                cur_off += add_off;
        }
        if (ti != NULL)
@@ -965,11 +960,6 @@ dissect_answer_records(tvbuff_t *tvb, int cur_off, int nbns_data_offset,
        while (count-- > 0) {
                add_off = dissect_nbns_answer(tvb, cur_off, nbns_data_offset,
                                        cinfo, qatree, opcode);
-               if (add_off <= 0) {
-                       /* We ran past the end of the captured data in the
-                          packet. */
-                       break;
-               }
                cur_off += add_off;
        }
        if (ti != NULL)