aboutsummaryrefslogtreecommitdiffstats
path: root/packet-trmac.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2002-06-02 17:51:00 +0000
committerGerald Combs <gerald@wireshark.org>2002-06-02 17:51:00 +0000
commit8de8efa28443cf831aebe970d8317b0d33749d53 (patch)
tree8c53a8bb55b229469b7256cd6662e7159afe9c99 /packet-trmac.c
parent6fb5e72ab1b1457f10bab5894c5db3164604b4f2 (diff)
Mark frames with a subvector length of less than one as being invalid.
svn path=/trunk/; revision=5610
Diffstat (limited to 'packet-trmac.c')
-rw-r--r--packet-trmac.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/packet-trmac.c b/packet-trmac.c
index ed8fbb322b..a400762a12 100644
--- a/packet-trmac.c
+++ b/packet-trmac.c
@@ -2,7 +2,7 @@
* Routines for Token-Ring Media Access Control
* Gilbert Ramirez <gram@alumni.rice.edu>
*
- * $Id: packet-trmac.c,v 1.35 2002/01/21 07:36:44 guy Exp $
+ * $Id: packet-trmac.c,v 1.36 2002/06/02 17:51:00 gerald Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -34,6 +34,7 @@
#include <string.h>
#include <glib.h>
#include <epan/packet.h>
+#include "packet-frame.h"
static int proto_trmac = -1;
static int hf_trmac_mv = -1;
@@ -115,6 +116,15 @@ sv_text(tvbuff_t *tvb, int svoff, proto_tree *tree)
u_char errors[6]; /* isolating or non-isolating */
+ /* Check the SV length.
+ XXX - Should we do this in each case statement below, e.g. to force
+ an SV length of 6 for the NAUN address? */
+ if (sv_length < 1) {
+ proto_tree_add_protocol_format(tree, proto_malformed, tvb, svoff+0, 1,
+ "Invalid subvector length: %d bytes", sv_length);
+ return sv_length;
+ }
+
/* this just adds to the clutter on the screen...
proto_tree_add_text(tree, tvb, svoff, 1,
"Subvector Length: %d bytes", sv_length);*/