Don't list the attribute-value pairs if the length field of the packet
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 18 Jun 2001 09:31:15 +0000 (09:31 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 18 Jun 2001 09:31:15 +0000 (09:31 +0000)
says there aren't any (i.e., if the length field minus the size of the
stuff before the AVP's is less than or equal to 0).

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

packet-radius.c

index 432baadc2357f1e9c599aa9c69f07138e3f04b0f..7640ad38111fad6132b1b34d26ced7d997b6059f 100644 (file)
@@ -2,7 +2,7 @@
  * Routines for RADIUS packet disassembly
  * Copyright 1999 Johan Feyaerts
  *
- * $Id: packet-radius.c,v 1.31 2001/06/18 02:17:51 guy Exp $
+ * $Id: packet-radius.c,v 1.32 2001/06/18 09:31:15 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@ethereal.com>
@@ -727,17 +727,19 @@ static void dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        hdrlength=RD_HDR_LENGTH+AUTHENTICATOR_LENGTH;
         avplength= rhlength -hdrlength;
 
-        /* list the attribute value pairs */
+        if (avplength > 0) {
+                /* list the attribute value pairs */
 
-        avptf = proto_tree_add_text(radius_tree,
-                        tvb,hdrlength,avplength,
-                        "Attribute value pairs");
-        avptree = proto_item_add_subtree(avptf, ett_radius_avp);
+                avptf = proto_tree_add_text(radius_tree,
+                                tvb,hdrlength,avplength,
+                                "Attribute value pairs");
+                avptree = proto_item_add_subtree(avptf, ett_radius_avp);
 
-        if (avptree !=NULL)
-        {
-                dissect_attribute_value_pairs(tvb, hdrlength,
+                if (avptree !=NULL)
+                {
+                        dissect_attribute_value_pairs(tvb, hdrlength,
                                 avptree,avplength);
+                }
         }
   }
 }