aboutsummaryrefslogtreecommitdiffstats
path: root/packet-trmac.c
diff options
context:
space:
mode:
authorgram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1999-01-12 17:44:52 +0000
committergram <gram@f5534014-38df-0310-8fa8-9805f1628bb7>1999-01-12 17:44:52 +0000
commit23641f4f8c78146919bcb5ea5f37bac8c10ab031 (patch)
tree47554570fcd9c69127a1df0722aa29704826e1f6 /packet-trmac.c
parentc1039004e8d52bd2bda1ec74548bcc22f7e8626e (diff)
Fixed a bug regarding bad packets. If a sub-vector indicated a 0-length,
dissect_trmac() would spin in an infinite loop. Now that condition is checked and properly handled. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@168 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-trmac.c')
-rw-r--r--packet-trmac.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/packet-trmac.c b/packet-trmac.c
index 2ef6974ff8..7b95141444 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.8 1998/11/17 04:29:06 gerald Exp $
+ * $Id: packet-trmac.c,v 1.9 1999/01/12 17:44:52 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@@ -258,7 +258,7 @@ void
dissect_trmac(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) {
GtkWidget *mac_tree = NULL, *ti;
- int mv_length, sv_length, sv_offset;
+ int mv_length, sv_length, sv_offset, sv_additional;
char *class[] = { "Ring Station", "LLC Manager", "", "",
"Configuration Report Server", "Ring Parameter Server",
"Ring Error Monitor" };
@@ -301,8 +301,15 @@ dissect_trmac(const u_char *pd, int offset, frame_data *fd, GtkTree *tree) {
offset += 4;
sv_length = mv_length - 4;
while (sv_offset < sv_length) {
- sv_offset += sv_text(&pd[offset + sv_offset], offset + sv_offset,
+ sv_additional = sv_text(&pd[offset + sv_offset], offset + sv_offset,
mac_tree);
+
+ /* if this is a bad packet, we could get a 0-length added here,
+ * looping forever */
+ if (sv_additional)
+ sv_offset += sv_additional;
+ else
+ break;
}
}
}