diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-09-27 10:19:14 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-09-27 10:19:14 +0000 |
commit | 43cd2ff411bb10c7efb20e0e71eecb8756672133 (patch) | |
tree | 226e977d339792cdf850a0983b5acf0ee023ea2b /packet-udp.c | |
parent | f5ae39b540366422c6f7ac29b19fb2d66233b0db (diff) |
If the amount of available data in a UDP packet is less than the length,
as reported in the header, don't checksum the packet.
svn path=/trunk/; revision=3959
Diffstat (limited to 'packet-udp.c')
-rw-r--r-- | packet-udp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packet-udp.c b/packet-udp.c index de0db83c55..6efa0af98b 100644 --- a/packet-udp.c +++ b/packet-udp.c @@ -1,7 +1,7 @@ /* packet-udp.c * Routines for UDP packet disassembly * - * $Id: packet-udp.c,v 1.94 2001/06/18 02:17:53 guy Exp $ + * $Id: packet-udp.c,v 1.95 2001/09/27 10:19:14 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -166,7 +166,7 @@ dissect_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* No checksum supplied in the packet. */ proto_tree_add_uint_format(udp_tree, hf_udp_checksum, tvb, offset + 6, 2, uh_sum, "Checksum: 0x%04x (none)", uh_sum); - } else if (!pinfo->fragmented && len >= reported_len) { + } else if (!pinfo->fragmented && len >= reported_len && len >= uh_ulen) { /* The packet isn't part of a fragmented datagram and isn't truncated, so we can checksum it. XXX - make a bigger scatter-gather list once we do fragment |