aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.h
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-11-06 21:49:34 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2002-11-06 21:49:34 +0000
commit791d7eff86fd66492541d4265c497aa8ee2dd92b (patch)
tree1772ded2ad88a8ad9de7bf9298526f61b4cff663 /epan/packet.h
parent521b66601b2dfffb4db23dffb1f91afc078bcd37 (diff)
From Solomon Peachy: support for new "wlancap" 802.11 extra-information
header. Add overflow checks to "BYTES_ARE_IN_FRAME()", and cast all arguments to unsigned values (negative values should never be passed) to squelch compiler warnings. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6567 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/packet.h')
-rw-r--r--epan/packet.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/packet.h b/epan/packet.h
index 394a849be4..2cbd8a01a9 100644
--- a/epan/packet.h
+++ b/epan/packet.h
@@ -1,7 +1,7 @@
/* packet.h
* Definitions for packet disassembly structures and routines
*
- * $Id: packet.h,v 1.63 2002/10/25 23:23:28 guy Exp $
+ * $Id: packet.h,v 1.64 2002/11/06 21:49:32 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -46,7 +46,8 @@
/* Check whether the "len" bytes of data starting at "offset" is
* entirely inside the captured data for this packet. */
#define BYTES_ARE_IN_FRAME(offset, captured_len, len) \
- ((offset) + (len) <= (captured_len))
+ ((guint)(offset) + (guint)(len) > (guint)(offset) && \
+ (guint)(offset) + (guint)(len) <= (guint)(captured_len))
/* To pass one of two strings, singular or plural */
#define plurality(d,s,p) ((d) == 1 ? (s) : (p))