summaryrefslogtreecommitdiff
path: root/wiretap/csids.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-04-29 19:04:17 -0700
committerGuy Harris <guy@alum.mit.edu>2016-04-30 02:04:50 +0000
commitc34cf306ab90307c23371d638478bce1d348388d (patch)
treeb2f59efe586f99b9d0fd91f3b925fedf368e1770 /wiretap/csids.c
parent44f72a90eaffc8a0322b377c4a66c11bf63340dc (diff)
downloadwireshark-c34cf306ab90307c23371d638478bce1d348388d.tar.gz
Note some cases where we don't need to check the packet length.
These file formats have 16-bit packet lengths, so, even with some extra metadata added, the packet data length will never be bigger than WTAP_MAX_PACKET_SIZE. (No, we won't ever reduce WTAP_MAX_PACKET_SIZE.) Change-Id: I9e1b1d90971f91cc6e5d66d0aa93841445b2bc22 Reviewed-on: https://code.wireshark.org/review/15186 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap/csids.c')
-rw-r--r--wiretap/csids.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/wiretap/csids.c b/wiretap/csids.c
index 387f54dfa5..3f4b3eefcc 100644
--- a/wiretap/csids.c
+++ b/wiretap/csids.c
@@ -179,6 +179,11 @@ csids_read_packet(FILE_T fh, csids_t *csids, struct wtap_pkthdr *phdr,
return FALSE;
hdr.seconds = pntoh32(&hdr.seconds);
hdr.caplen = pntoh16(&hdr.caplen);
+ /*
+ * The maximum value of hdr.caplen is 65535, which is less than
+ * WTAP_MAX_PACKET_SIZE will ever be, so we don't need to check
+ * it.
+ */
phdr->rec_type = REC_TYPE_PACKET;
phdr->presence_flags = WTAP_HAS_TS;