diff options
author | Guy Harris <guy@alum.mit.edu> | 2002-11-06 21:49:34 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2002-11-06 21:49:34 +0000 |
commit | 8ee4a65f7690f5563275f4b1718971af2e5faca8 (patch) | |
tree | 1772ded2ad88a8ad9de7bf9298526f61b4cff663 /epan/packet.h | |
parent | b3e0a56390fdce140228692d9ad3389bfa71c876 (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.
svn path=/trunk/; revision=6567
Diffstat (limited to 'epan/packet.h')
-rw-r--r-- | epan/packet.h | 5 |
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)) |