mirror of
https://github.com/upx/upx
synced 2025-10-12 20:59:43 +08:00
find_overlay_offset() did not check carefully enough
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65518 https://github.com/upx/upx/issues/760 modified: p_unix.cpp
This commit is contained in:
parent
3dca1175e5
commit
6dde9f7dc0
|
@ -581,7 +581,7 @@ int PackUnix::find_overlay_offset(MemBuffer const &buf)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int l = ph.buf_offset + ph.getPackHeaderSize();
|
int l = ph.buf_offset + ph.getPackHeaderSize();
|
||||||
if (l < 0 || l + 4 > bufsize)
|
if (l < 0 || i + l + 4 > bufsize)
|
||||||
throwCantUnpack("file corrupted");
|
throwCantUnpack("file corrupted");
|
||||||
overlay_offset = get_te32(buf + i + l);
|
overlay_offset = get_te32(buf + i + l);
|
||||||
if ((off_t)overlay_offset >= file_size)
|
if ((off_t)overlay_offset >= file_size)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user