1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 19:52:20 +02:00

Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  NEWS
  Fix bug #68283: fileinfo: out-of-bounds read in elf note headers
This commit is contained in:
Remi Collet
2014-10-25 11:30:29 +02:00

View File

@@ -492,6 +492,13 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
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;