diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-04-29 19:04:17 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-04-30 02:04:50 +0000 |
commit | c34cf306ab90307c23371d638478bce1d348388d (patch) | |
tree | b2f59efe586f99b9d0fd91f3b925fedf368e1770 /wiretap/camins.c | |
parent | 44f72a90eaffc8a0322b377c4a66c11bf63340dc (diff) | |
download | wireshark-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/camins.c')
-rw-r--r-- | wiretap/camins.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/wiretap/camins.c b/wiretap/camins.c index 90e3e2c486..4923ac49e8 100644 --- a/wiretap/camins.c +++ b/wiretap/camins.c @@ -244,6 +244,12 @@ camins_read_packet(FILE_T fh, struct wtap_pkthdr *phdr, Buffer *buf, if (!find_next_pkt_dat_type_len(fh, &dat_trans_type, &dat_len, err, err_info)) return FALSE; + /* + * The maximum value of length is 65535, which, even after + * DVB_CI_PSEUDO_HDR_LEN is added to it, is less than + * WTAP_MAX_PACKET_SIZE will ever be, so we don't need to check + * it. + */ ws_buffer_assure_space(buf, DVB_CI_PSEUDO_HDR_LEN+dat_len); p = ws_buffer_start_ptr(buf); |