aboutsummaryrefslogtreecommitdiffstats
path: root/packet-msproxy.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-08-06 07:22:38 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-08-06 07:22:38 +0000
commita3dd49742a0ca5198d2c0650dedd37626b252d6c (patch)
tree15fd7095c9d57da2f1ec8b38841613236c1a1740 /packet-msproxy.c
parentb90978d08519624e351848eaae4dc750968deb93 (diff)
Don't use "fd->pkt_len" when checking to see if you've run off the end
of the packet, use "pi.captured_len" - "fd->pkt_len" may include data that isn't in the capture, due to a short snapshot length. Don't use "fd->cap_len" when checking to see if you've run off the end of the packe, use "pi.captured_len" - "fd->cap_len" isn't adjusted to reflect any length fields, but "pi.captured_len" is (removing, for example, Ethernet padding from the packet). Use "END_OF_FRAME" rather than "pi.captured_len - offset", to make it a bit clearer what's being done. In the V.120 dissector, use "tvb_length()" when adding the top-level protocol tree entry for V.120, as it's a tvbuffified dissector. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2214 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-msproxy.c')
-rw-r--r--packet-msproxy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/packet-msproxy.c b/packet-msproxy.c
index 784fd5e88b..a519841f2c 100644
--- a/packet-msproxy.c
+++ b/packet-msproxy.c
@@ -2,7 +2,7 @@
* Routines for Microsoft Proxy packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-msproxy.c,v 1.4 2000/05/31 16:49:42 gram Exp $
+ * $Id: packet-msproxy.c,v 1.5 2000/08/06 07:22:34 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -78,7 +78,7 @@
# include "snprintf.h"
#endif
-#define CHECK_PACKET_LENGTH(X) if ((offset+X) > fd->cap_len){ \
+#define CHECK_PACKET_LENGTH(X) if ((offset+X) > pi.captured_len){ \
proto_tree_add_text(tree, NullTVB, offset, 0, "****FRAME TOO SHORT***"); return;}
extern void udp_hash_add(guint16 proto,
@@ -323,7 +323,7 @@ static int display_application_name(const u_char *pd, int offset,
char temp[255];
- if ((offset+ 1) > fd->cap_len){
+ if ((offset+ 1) > pi.captured_len){
proto_tree_add_text(tree, NullTVB, offset, 0, "****FRAME TOO SHORT***");
return 0;
}