mirror of
https://github.com/php/php-src.git
synced 2024-12-01 05:43:38 +08:00
Fix bug #68283: fileinfo: out-of-bounds read in elf note headers
Upstream commit39c7ac1106
CVE -2014-3710 (cherry picked from commit1803228597
)
This commit is contained in:
parent
37d5a2b18f
commit
5b295bf191
@ -372,6 +372,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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user