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:
committed by
Markus F.X.J. Oberhumer
parent
3dca1175e5
commit
6dde9f7dc0
+1
-1
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user