diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-05-04 06:01:52 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-05-04 06:01:52 +0000 |
commit | 827fd49e7258fee62554d5c59a474b893534b6ff (patch) | |
tree | a0cb2499991af39c329d0867be94cac3a6aa92f0 /packet-cops.c | |
parent | de6fdc190b849aecd46da9dd11b08f55d6792c5c (diff) |
Don't assume the length field in a PacketCable object is sane.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10783 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-cops.c')
-rw-r--r-- | packet-cops.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packet-cops.c b/packet-cops.c index 3c7a0e0d84..76118cbfcb 100644 --- a/packet-cops.c +++ b/packet-cops.c @@ -13,7 +13,7 @@ * * Implemented in ethereal at April 7-8, 2004 * - * $Id: packet-cops.c,v 1.47 2004/04/30 21:11:25 guy Exp $ + * $Id: packet-cops.c,v 1.48 2004/05/04 06:01:52 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -2555,6 +2555,12 @@ void cops_analyze_packetcable_obj(tvbuff_t *tvb, proto_tree *tree, guint32 offse /* In case we have remaining data, then lets try to get this analyzed */ object_len = tvb_get_ntohs(tvb, offset); + if (object_len < 4) { + proto_tree_add_text(tree, tvb, offset, 2, + "Incorrect PacketCable object length %u < 4", object_len); + return; + } + s_num = tvb_get_guint8(tvb, offset + 2); s_type = tvb_get_guint8(tvb, offset + 3); |