summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2002-06-02 23:55:11 +0000
committerGerald Combs <gerald@wireshark.org>2002-06-02 23:55:11 +0000
commitcf247c736072417c5ba8526026c1431ee54db39d (patch)
tree9fccc7d19dee57715669b6a1a5d675a78562f55a
parent0caa130763f0320b65a4f2ac163ab9a931c24ff9 (diff)
downloadwireshark-cf247c736072417c5ba8526026c1431ee54db39d.tar.gz
Require that the LMP and RSVP message types be greater than 0.
svn path=/trunk/; revision=5612
-rw-r--r--packet-lmp.c5
-rw-r--r--packet-rsvp.c13
2 files changed, 13 insertions, 5 deletions
diff --git a/packet-lmp.c b/packet-lmp.c
index cd208efc6c..aabe682e95 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.7 2002/06/02 21:42:58 gerald Exp $
+ * $Id: packet-lmp.c,v 1.8 2002/06/02 23:55:11 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -828,7 +828,8 @@ 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);
- if (LMPF_MSG + message_type <= LMPF_MSG_CHANNEL_STATUS_RESP) {
+ if (LMPF_MSG + message_type <= LMPF_MSG_CHANNEL_STATUS_RESP &&
+ message_type > 0) {
proto_tree_add_boolean_hidden(lmp_header_tree, lmp_filter[LMPF_MSG + message_type], tvb,
offset+3, 1, 1);
} else {
diff --git a/packet-rsvp.c b/packet-rsvp.c
index 2e5514f79a..5f6a8ed61c 100644
--- a/packet-rsvp.c
+++ b/packet-rsvp.c
@@ -3,7 +3,7 @@
*
* (c) Copyright Ashok Narayanan <ashokn@cisco.com>
*
- * $Id: packet-rsvp.c,v 1.65 2002/05/30 08:34:18 guy Exp $
+ * $Id: packet-rsvp.c,v 1.66 2002/06/02 23:55:11 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -74,6 +74,7 @@
#include "packet-rsvp.h"
#include "packet-ip.h"
+#include "packet-frame.h"
static int proto_rsvp = -1;
@@ -3590,12 +3591,18 @@ dissect_rsvp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ver_flags & 0xf);
proto_tree_add_uint(rsvp_header_tree, rsvp_filter[RSVPF_MSG], tvb,
offset+1, 1, message_type);
- if (message_type <= RSVPF_RTEARCONFIRM &&
+ if (RSVPF_MSG + message_type <= RSVPF_RTEARCONFIRM &&
message_type != RSVPF_JUNK_MSG8 &&
- message_type != RSVPF_JUNK_MSG9 ) {
+ message_type != RSVPF_JUNK_MSG9 &&
+ message_type > 0) {
proto_tree_add_boolean_hidden(rsvp_header_tree, rsvp_filter[RSVPF_MSG + message_type], tvb,
offset+1, 1, 1);
+ } else {
+ proto_tree_add_protocol_format(rsvp_header_tree, proto_malformed, tvb, offset+1, 1,
+ "Invalid message type: %u", message_type);
+ return;
}
+
cksum = tvb_get_ntohs(tvb, offset+2);
if (!pinfo->fragmented && (int) tvb_length(tvb) >= msg_length) {
/* The packet isn't part of a fragmented datagram and isn't