URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=9402f2f80c6bc7d25178a0875c5a1f5ee36361db
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master-2.2
Repository: wireshark
Commits:
9402f2f by Peter Wu (peter@xxxxxxxxxxxxx):
ber: clamp BER lengths to avoid integer overflow
Many callers treat the length as signed integer, so ensure that the
length fits in such a number. Failure to do so can have unintended
consequences (such as calling "tvb_memdup(tvb, 0, -1)" and assuming that
the length is actually 2^32-1).
Although an exception could be thrown as well, let's give the caller a
chance to handle this themselves.
Change-Id: If92545f7d3603250f75741040435000ba879b7e3
Ping-Bug: 14682
Reviewed-on: https://code.wireshark.org/review/27563
Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
(cherry picked from commit 67c642047362b5e2546259dd012622ff3dd6c9d9)
Reviewed-on: https://code.wireshark.org/review/27967
Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
Actions performed:
from 723abd3 ber: fix buffer overrun (read) in dissect_ber_constrained_bitstring
adds 9402f2f ber: clamp BER lengths to avoid integer overflow
Summary of changes:
epan/dissectors/packet-ber.c | 5 +++++
1 file changed, 5 insertions(+)