aboutsummaryrefslogtreecommitdiffstats
path: root/packet-lmp.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2002-06-16 17:08:43 +0000
committerGerald Combs <gerald@wireshark.org>2002-06-16 17:08:43 +0000
commit0641e38087255f2f356bb7af7ca57f1d47cdb746 (patch)
tree3ab7c8cc662ef5e12220ca9930d4986e7194b9e0 /packet-lmp.c
parent0087a8a56ef85ed05dc3eb75529c095a1a0494d0 (diff)
Return an error for an invalid class instead of dumping core.
svn path=/trunk/; revision=5686
Diffstat (limited to 'packet-lmp.c')
-rw-r--r--packet-lmp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/packet-lmp.c b/packet-lmp.c
index aabe682e95..19a52b524d 100644
--- a/packet-lmp.c
+++ b/packet-lmp.c
@@ -3,7 +3,7 @@
*
* (c) Copyright Ashok Narayanan <ashokn@cisco.com>
*
- * $Id: packet-lmp.c,v 1.8 2002/06/02 23:55:11 gerald Exp $
+ * $Id: packet-lmp.c,v 1.9 2002/06/16 17:08:43 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -880,8 +880,14 @@ dissect_lmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
object_type = val_to_str(class, lmp_class_vals, "Unknown");
proto_tree_add_uint_hidden(lmp_tree, lmp_filter[LMPF_OBJECT], tvb,
offset, 1, class);
- ti = proto_tree_add_item(lmp_tree, lmp_filter[lmp_class_to_filter_num(class)],
+ if (VALID_CLASS(class)) {
+ ti = proto_tree_add_item(lmp_tree, lmp_filter[lmp_class_to_filter_num(class)],
tvb, offset, obj_length, FALSE);
+ } else {
+ proto_tree_add_protocol_format(lmp_tree, proto_malformed, tvb, offset+1, 1,
+ "Invalid class: %u", class);
+ return;
+ }
lmp_object_tree = proto_item_add_subtree(ti, lmp_class_to_subtree(class));