Check for a bogus length value.
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 7 Dec 2004 16:17:50 +0000 (16:17 +0000)
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 7 Dec 2004 16:17:50 +0000 (16:17 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12677 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-bvlc.c

index 64bd69092eeac117db29dc27f378676662828215..db50ccf8baf5ecfceaa41cbed086854defc7f8d7 100644 (file)
@@ -142,6 +142,11 @@ dissect_bvlc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
        }
 
        if (tree) {
+               if (bvlc_length < 4) {
+                       proto_tree_add_text(tree, tvb, 2, 2,
+                               "Bogus length: %d", bvlc_length);
+                       return;
+               }
                ti = proto_tree_add_item(tree, proto_bvlc, tvb, 0,
                        bvlc_length, FALSE);
                bvlc_tree = proto_item_add_subtree(ti, ett_bvlc);