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/netscaler.c | |
parent | 44f72a90eaffc8a0322b377c4a66c11bf63340dc (diff) |
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/netscaler.c')
-rw-r--r-- | wiretap/netscaler.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/wiretap/netscaler.c b/wiretap/netscaler.c index 9832000d7b..789146d7b1 100644 --- a/wiretap/netscaler.c +++ b/wiretap/netscaler.c @@ -938,6 +938,9 @@ static gboolean nstrace_set_start_time(wtap *wth) /* ** Netscaler trace format read routines. +** +** The maximum value of the record data size is 65535, which is less than +** WTAP_MAX_PACKET_SIZE will ever be, so we don't need to check it. */ #define TIMEDEFV10(phdr,fp,type) \ do {\ @@ -1075,6 +1078,10 @@ static gboolean nstrace_read_v10(wtap *wth, int *err, gchar **err_info, gint64 * #define TIMEDEFV25(phdr,fp,type) TIMEDEFV24(phdr,fp,type) #define TIMEDEFV26(phdr,fp,type) TIMEDEFV24(phdr,fp,type) +/* +** The maximum value of the record data size is 65535, which is less than +** WTAP_MAX_PACKET_SIZE will ever be, so we don't need to check it. +*/ #define PARTSIZEDEFV20(phdr,pp,ver) \ do {\ (phdr)->presence_flags |= WTAP_HAS_CAP_LEN;\ @@ -1244,6 +1251,10 @@ static gboolean nstrace_read_v20(wtap *wth, int *err, gchar **err_info, gint64 * #define TIMEDEFV35 TIMEDEFV30 +/* +** The maximum value of the record data size is 65535, which is less than +** WTAP_MAX_PACKET_SIZE will ever be, so we don't need to check it. +*/ #define FULLSIZEDEFV30(phdr,fp,ver)\ do {\ (phdr)->presence_flags |= WTAP_HAS_CAP_LEN;\ @@ -1665,6 +1676,8 @@ static gboolean nstrace_seek_read_v30(wtap *wth, gint64 seek_off, /* ** Get the record length. + ** The maximum value of the record data size is 65535, which is less + ** than WTAP_MAX_PACKET_SIZE will ever be, so we don't need to check it. */ record_length = nspr_getv20recordsize(&hdr); |