+2015-07-16 Alan Modra <amodra@gmail.com>
+
+ PR binutils/18672
+ * readelf.c (get_32bit_dynamic_section): Correct buffer limit test.
+ (get_64bit_dynamic_section): Likewise.
+
2015-07-14 H.J. Lu <hongjiu.lu@intel.com>
* objcopy.c (copy_file): Set BFD_COMPRESS_GABI if not
might not have the luxury of section headers. Look for the DT_NULL
terminator to determine the number of entries. */
for (ext = edyn, dynamic_nent = 0;
- (char *) ext < (char *) edyn + dynamic_size - sizeof (* entry);
+ (char *) (ext + 1) <= (char *) edyn + dynamic_size;
ext++)
{
dynamic_nent++;
might not have the luxury of section headers. Look for the DT_NULL
terminator to determine the number of entries. */
for (ext = edyn, dynamic_nent = 0;
- /* PR 17533 file: 033-67080-0.004 - do not read off the end of the buffer. */
- (char *) ext < ((char *) edyn) + dynamic_size - sizeof (* ext);
+ /* PR 17533 file: 033-67080-0.004 - do not read past end of buffer. */
+ (char *) (ext + 1) <= (char *) edyn + dynamic_size;
ext++)
{
dynamic_nent++;