tvbuff: make tvb_bytes_exist fail with negative values
authorPeter Wu <peter@lekensteyn.nl>
Mon, 14 May 2018 10:27:15 +0000 (12:27 +0200)
committerAnders Broman <a.broman58@gmail.com>
Mon, 14 May 2018 13:07:23 +0000 (13:07 +0000)
commitd80acae40d14efeb857258ca923637b590dd6be9
tree3370154fb920d7ab0f9b80e8226eaaec3dd157fe
parent17647c4041cfe05dbd5e08d68662007b1e8e4146
tvbuff: make tvb_bytes_exist fail with negative values

tvb_generic_clone_offset_len uses tvb_bytes_exist to check that the
requested tvb data is actually available. It did not expect negative
values, that would result in an overly large memory allocation.

Bug: 14678
Change-Id: Ie80095a381e55ca5dbbd5c9d835243549d0b212e
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7179
Reviewed-on: https://code.wireshark.org/review/27526
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
epan/tvbuff.c