+2014-10-17 11:48 Christos Zoulas <christos@zoulas.com>
+
+ * fix bounds in note reading (Francisco Alonso / Red Hat)
+
2014-10-11 15:02 Christos Zoulas <christos@zoulas.com>
* fix autoconf glue for setlocale and locale_t; some OS's
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.102 2014/03/11 21:00:13 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.103 2014/05/02 02:25:10 christos Exp $")
#endif
#ifdef BUILTIN_ELF
uint32_t namesz, descsz;
unsigned char *nbuf = CAST(unsigned char *, vbuf);
+ if (xnh_sizeof + offset > size) {
+ /*
+ * We're out of note headers.
+ */
+ return xnh_sizeof + offset;
+ }
+
(void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof);
offset += xnh_sizeof;