Re: [PATCH] readelf: Fix bounds check in print_form_data.

2018-06-11 Thread Mark Wielaard
On Mon, 2018-06-11 at 02:18 +0200, Mark Wielaard wrote: > The afl fuzzer found that we did a wrong check in print_form_data when > comparing the remaining bytes in the buffer to an (unsigned) value read. > We were casting the value to ptrdiff_t which is a signed value and so > might turn a really b

[PATCH] readelf: Fix bounds check in print_form_data.

2018-06-10 Thread Mark Wielaard
The afl fuzzer found that we did a wrong check in print_form_data when comparing the remaining bytes in the buffer to an (unsigned) value read. We were casting the value to ptrdiff_t which is a signed value and so might turn a really big unsigned value into a negative number. Since we know the diff