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/peekclassic.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/peekclassic.c')
-rw-r--r-- | wiretap/peekclassic.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/wiretap/peekclassic.c b/wiretap/peekclassic.c index 79c294c266..5cbefbb394 100644 --- a/wiretap/peekclassic.c +++ b/wiretap/peekclassic.c @@ -434,6 +434,11 @@ static int peekclassic_read_packet_v7(wtap *wth, FILE_T fh, if (0 == sliceLength) { sliceLength = length; } + /* + * The maximum value of sliceLength and length are 65535, which + * are less than WTAP_MAX_PACKET_SIZE will ever be, so we don't + * need to check them. + */ /* fill in packet header values */ phdr->rec_type = REC_TYPE_PACKET; @@ -613,6 +618,11 @@ static gboolean peekclassic_read_packet_v56(wtap *wth, FILE_T fh, if (0 == sliceLength) { sliceLength = length; } + /* + * The maximum value of sliceLength and length are 65535, which + * are less than WTAP_MAX_PACKET_SIZE will ever be, so we don't + * need to check them. + */ /* fill in packet header values */ phdr->rec_type = REC_TYPE_PACKET; |