From f93c76fd10c0899a5ce6b8eae5009c5b374cdbd8 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 26 Aug 1999 07:34:43 +0000 Subject: Convert a bunch of uses of "fd->cap_len" to use "pi.captured_len" (or to use END_OF_FRAME), so that they don't look at stuff in an IP datagram past the end of the IP datagram (i.e., frame padding). svn path=/trunk/; revision=584 --- packet-rip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packet-rip.c') diff --git a/packet-rip.c b/packet-rip.c index c2fa6c7f89..f81efc48fc 100644 --- a/packet-rip.c +++ b/packet-rip.c @@ -2,7 +2,7 @@ * Routines for RIPv1 and RIPv2 packet disassembly * (c) Copyright Hannes R. Boehm * - * $Id: packet-rip.c,v 1.11 1999/08/04 00:33:11 guy Exp $ + * $Id: packet-rip.c,v 1.12 1999/08/26 07:34:40 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -92,7 +92,7 @@ dissect_rip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { col_add_str(fd, COL_INFO, packet_type[rip_header.command]); if (tree) { - ti = proto_tree_add_item(tree, proto_rip, offset, (fd->cap_len - offset), NULL); + ti = proto_tree_add_item(tree, proto_rip, offset, END_OF_FRAME, NULL); rip_tree = proto_item_add_subtree(ti, ETT_RIP); proto_tree_add_text(rip_tree, offset, 1, "Command: %d (%s)", rip_header.command, packet_type[rip_header.command]); @@ -105,7 +105,7 @@ dissect_rip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { /* zero or more entries */ - while((fd->cap_len - offset) >= RIP_ENTRY_LENGTH){ + while((pi.captured_len - offset) >= RIP_ENTRY_LENGTH){ memcpy(&rip_entry, &pd[offset], sizeof(rip_entry)); /* avoid alignment problem */ family = ntohs(rip_entry.vektor.family); switch (family) { -- cgit v1.2.3