diff options
-rw-r--r-- | packet-tr.c | 7 | ||||
-rw-r--r-- | packet-trmac.c | 13 |
2 files changed, 15 insertions, 5 deletions
diff --git a/packet-tr.c b/packet-tr.c index fa7023f763..1f87c82bbd 100644 --- a/packet-tr.c +++ b/packet-tr.c @@ -2,7 +2,7 @@ * Routines for Token-Ring packet disassembly * Gilbert Ramirez <gram@verdict.uthscsa.edu> * - * $Id: packet-tr.c,v 1.23 1999/08/27 19:27:11 gram Exp $ + * $Id: packet-tr.c,v 1.24 1999/09/09 04:47:16 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -452,7 +452,10 @@ dissect_tr(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { /* if we have more than 2 bytes of RIF, then we have ring/bridge pairs */ - if (trn_rif_bytes > 2) { + if (trn_rif_bytes > 18) { + proto_tree_add_text(tr_tree, offset + 14, 1, + "Illegal number of RIF bytes: %d", trn_rif_bytes); + } else if (trn_rif_bytes > 2) { add_ring_bridge_pairs(trn_rif_bytes, pd + offset, offset, tr_tree); } diff --git a/packet-trmac.c b/packet-trmac.c index 67d6f04d5d..e219422c38 100644 --- a/packet-trmac.c +++ b/packet-trmac.c @@ -2,7 +2,7 @@ * Routines for Token-Ring Media Access Control * Gilbert Ramirez <gram@verdict.uthscsa.edu> * - * $Id: packet-trmac.c,v 1.13 1999/07/29 05:47:06 gram Exp $ + * $Id: packet-trmac.c,v 1.14 1999/09/09 04:47:17 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@unicom.net> @@ -72,6 +72,7 @@ static int sv_text(const u_char *pd, int pkt_offset, proto_tree *tree) { int sv_length = pd[0]; + guint16 beacon_type; char *beacon[] = {"Recovery mode set", "Signal loss error", "Streaming signal not Claim Token MAC frame", @@ -88,8 +89,14 @@ sv_text(const u_char *pd, int pkt_offset, proto_tree *tree) switch(pd[1]) { case 0x01: /* Beacon Type */ - proto_tree_add_text(tree, pkt_offset+1, sv_length-1, - "Beacon Type: %s", beacon[ pntohs( &pd[2] ) ] ); + beacon_type = pntohs(&pd[2]); + if (beacon_type < array_length(beacon)) { + proto_tree_add_text(tree, pkt_offset+1, sv_length-1, + "Beacon Type: %s", beacon[beacon_type] ); + } else { + proto_tree_add_text(tree, pkt_offset+1, sv_length-1, + "Beacon Type: Illegal value: %d", beacon_type ); + } break; case 0x02: /* NAUN */ |