Closed PracaGrande closed 6 years ago
Something is wrong with the pull request, because instead of showing up as a modification to the existing lib/afflib_pages.cpp, it is showing up as a new file tools/afflib_pages.cpp.
Try one more time with a new pull request if you like, or let me know and I'll just take care of it.
Hi Phillip , might be faster if you could do it please. Not sure what happened.
Not a problem. I will take care of it.
Fixed in 435a2ca.
Hi,
While fuzzing AFFLib tools with AFL, I came a cross a segmentation fault. When using affinfo 3.7.16, to open a specially crafted AFF file, a programming error occurs in the function af_get_page(), in afflib_pages.cpp, that can cause a segmentation fault or an undefined behavior due to passing a fishy (possibly negative) value as argument of 'size' to the function malloc.
Below is the output of valgrind when running affinfo with the forged AFF file.
After speaking with Phillip Hellewell about it, he suggested we should add the following sanity check:
before the following snippet of code:
Thanks, Luis