From ca61d69c63d7637e42920530803e82bbe93b8bb4 Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Thu, 9 Sep 1999 04:47:17 +0000 Subject: Removed two cases where protocol decoding assumed that the data in the packets were correct. Bad packets could cause segfaults. svn path=/trunk/; revision=641 --- packet-tr.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'packet-tr.c') 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 * - * $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 @@ -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); } -- cgit v1.2.1