[PATCH] readelf.c: fix multiple pointer overflows

nick clifton nickc@redhat.com
Tue Jan 29 09:15:00 GMT 2013
Hi Xi,

> Many compilers such as gcc and clang optimize away overflow checks
> `p + n < p', because in C pointer overflow is undefined behavior.
> Use a safe form `n > end - p' instead.

Thanks for reporting this problem.  I have checked your patch in along 
with the following changelog entry.

Cheers
   Nick

binutils/ChangeLog
2013-01-29  Xi Wang  <xi.wang@gmail.com>

	* readelf.c (process_version_sections): Fix overflow checks to
	avoid undefined behaviour.



More information about the Binutils mailing list