dumpcap: fix buffer overflow on packets larger than 2048 bytes
authorPeter Wu <peter@lekensteyn.nl>
Thu, 29 Jun 2017 20:44:08 +0000 (22:44 +0200)
committerAnders Broman <a.broman58@gmail.com>
Fri, 30 Jun 2017 03:46:55 +0000 (03:46 +0000)
commit8f8a0f72b442efe66c7ee26417a92508a1546289
tree0b27f72495d2d90deaaf7a2a7168d10d9089b7a6
parent58095359104cd42456aad1156ac8eb6776732cb3
dumpcap: fix buffer overflow on packets larger than 2048 bytes

When the current capture buffer is too small, it must be increased
before attempting to read the next data packet.

Fix developed by Mikael Kanstrup (and Guy), I added comments such that
the next reader does not have to guess whether "incl_len" is
accidentally used for reading from the buffer (it is not).

Change-Id: I980bd21ac79601a34d57ffc99a34bfb54c297ac0
Fixes: v2.5.0rc0-28-gd0865fd619 ("Allow bigger snapshot lengths for D-Bus captures.")
Bug: 13852
Reviewed-on: https://code.wireshark.org/review/22464
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
dumpcap.c