Wireshark-commits: [Wireshark-commits] lts-1.12.1 1a8ed46: Fix packet length handling.
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=1a8ed46c02e2aad04b30ccaf916b4ad553e28467
Submitter: Balint Reczey (balint@xxxxxxxxxxxxxxx)
Changed: branch: lts-1.12.1
Repository: wireshark
Commits:
1a8ed46 by Guy Harris (guy@xxxxxxxxxxxx):
Fix packet length handling.
Treat the packet length as unsigned - it shouldn't be negative in the
file. If it is, that'll probably cause the sscanf to fail, so we'll
report the file as bad.
Check it against WTAP_MAX_PACKET_SIZE to make sure we don't try to
allocate a huge amount of memory, just as we do in other file readers.
Use the now-validated packet size as the length in
ws_buffer_assure_space(), so we are certain to have enough space, and
don't allocate too much space.
Bug: 12394
Change-Id: If0b79376fc6fe2f49c7b7d7796dee7b7683485cb
Reviewed-on: https://code.wireshark.org/review/15171
Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
(cherry picked from commit 303680c3eae0263854c80845a660a1784d731533)
Reviewed-on: https://code.wireshark.org/review/16111
Reviewed-by: Balint Reczey <balint@xxxxxxxxxxxxxxx>
Actions performed:
from c5e64fe Dynamically allocate info string to prevent stack overflow.
adds 1a8ed46 Fix packet length handling.
Summary of changes:
wiretap/toshiba.c | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)