From 529ddabb5dad4938c3b6d06582d84fabac687486 Mon Sep 17 00:00:00 2001 From: gerald Date: Sun, 2 Jun 2002 17:51:00 +0000 Subject: Mark frames with a subvector length of less than one as being invalid. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5610 f5534014-38df-0310-8fa8-9805f1628bb7 --- packet-trmac.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'packet-trmac.c') 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 * - * $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 @@ -34,6 +34,7 @@ #include #include #include +#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);*/ -- cgit v1.2.3