diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-08-06 10:04:15 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-08-06 10:04:15 +0000 |
commit | a056a4d4469a97fed144343020231083889aa987 (patch) | |
tree | 8674f6a4991e831c2e63ca459e868b72e3b29846 /packet-msproxy.c | |
parent | ef5f866b73430d1df38f2fdd0df16a6d83598744 (diff) | |
download | wireshark-a056a4d4469a97fed144343020231083889aa987.tar.gz wireshark-a056a4d4469a97fed144343020231083889aa987.tar.bz2 wireshark-a056a4d4469a97fed144343020231083889aa987.zip |
Use "BYTES_ARE_IN_FRAME()" rather than explicitly checking an offset and
packet length.
Use "IS_DATA_IN_FRAME()", rather than checking if "offset+1" is greater
than "pi.captured_len", to check whether there's any data left in the
packet.
Check whether data is in the packet *before* extracting it and stuffing
an item into the tree with it.
svn path=/trunk/; revision=2216
Diffstat (limited to 'packet-msproxy.c')
-rw-r--r-- | packet-msproxy.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packet-msproxy.c b/packet-msproxy.c index a519841f2c..6ac41a644f 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.5 2000/08/06 07:22:34 guy Exp $ + * $Id: packet-msproxy.c,v 1.6 2000/08/06 10:04:13 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) > pi.captured_len){ \ +#define CHECK_PACKET_LENGTH(X) if (!BYTES_ARE_IN_FRAME(offset, X)){ \ 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) > pi.captured_len){ + if (!IS_DATA_IN_FRAME(offset)){ proto_tree_add_text(tree, NullTVB, offset, 0, "****FRAME TOO SHORT***"); return 0; } |