From cf247c736072417c5ba8526026c1431ee54db39d Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Sun, 2 Jun 2002 23:55:11 +0000 Subject: Require that the LMP and RSVP message types be greater than 0. svn path=/trunk/; revision=5612 --- packet-rsvp.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'packet-rsvp.c') 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 * - * $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 @@ -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 -- cgit v1.2.1