This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] readelf.c: fix multiple pointer overflows


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]