aboutsummaryrefslogtreecommitdiffstats
path: root/packet-msproxy.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-08-06 10:04:15 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-08-06 10:04:15 +0000
commit2f256182d6ea16f67bb9d81d88d0308925b6b9da (patch)
tree8674f6a4991e831c2e63ca459e868b72e3b29846 /packet-msproxy.c
parent4cd5de98062de54ca49f6370acbc878196753c4d (diff)
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2216 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 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;
}