aboutsummaryrefslogtreecommitdiffstats
path: root/packet-lmp.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2002-06-02 21:42:58 +0000
committerGerald Combs <gerald@wireshark.org>2002-06-02 21:42:58 +0000
commit0caa130763f0320b65a4f2ac163ab9a931c24ff9 (patch)
tree3d945ae744653b9f1c9e4b5ca33d66fbbe603970 /packet-lmp.c
parent8de8efa28443cf831aebe970d8317b0d33749d53 (diff)
Mark a frame invalid if its message type value exceeds
LMPF_MSG_CHANNEL_STATUS_RESP. svn path=/trunk/; revision=5611
Diffstat (limited to 'packet-lmp.c')
-rw-r--r--packet-lmp.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/packet-lmp.c b/packet-lmp.c
index e36177d62c..cd208efc6c 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.6 2002/05/10 18:37:38 ashokn Exp $
+ * $Id: packet-lmp.c,v 1.7 2002/06/02 21:42:58 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -68,6 +68,7 @@
#include "packet-ip.h"
#include "packet-rsvp.h"
+#include "packet-frame.h"
static int proto_lmp = -1;
#define LMP_VER_DRAFT_CCAMP_02 2
@@ -827,8 +828,14 @@ dissect_lmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
offset+3, 1, message_type);
proto_tree_add_text(lmp_header_tree, tvb, offset+4, 2, "Length: %d bytes",
msg_length);
- proto_tree_add_boolean_hidden(lmp_header_tree, lmp_filter[LMPF_MSG + message_type], tvb,
+ if (LMPF_MSG + message_type <= LMPF_MSG_CHANNEL_STATUS_RESP) {
+ proto_tree_add_boolean_hidden(lmp_header_tree, lmp_filter[LMPF_MSG + message_type], tvb,
offset+3, 1, 1);
+ } else {
+ proto_tree_add_protocol_format(lmp_header_tree, proto_malformed, tvb, offset+3, 1,
+ "Invalid message type: %u", message_type);
+ return;
+ }
cksum = tvb_get_ntohs(tvb, offset+6);
if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) {