1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Check PackHeader before decompress; CERT-FI id:000002,sig:06,src:000000,op:flip1,pos:4629

This commit is contained in:
John Reiser 2015-05-08 20:13:44 -07:00
parent 0151b3f9b3
commit 8c0321697f

View File

@ -361,6 +361,9 @@ void ph_decompress(PackHeader &ph, const upx_bytep in, upx_bytep out,
}
// decompress
if (ph.u_len < ph.c_len) {
throwCantUnpack("header corrupted");
}
unsigned new_len = ph.u_len;
int r = upx_decompress(in, ph.c_len, out, &new_len, ph.method, &ph.compress_result);
if (r == UPX_E_OUT_OF_MEMORY)