Check PackHeader before decompress; CERT-FI id:000002,sig:06,src:000000,op:flip1,pos:4629
This commit is contained in:
@@ -361,6 +361,9 @@ void ph_decompress(PackHeader &ph, const upx_bytep in, upx_bytep out,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// decompress
|
// decompress
|
||||||
|
if (ph.u_len < ph.c_len) {
|
||||||
|
throwCantUnpack("header corrupted");
|
||||||
|
}
|
||||||
unsigned new_len = ph.u_len;
|
unsigned new_len = ph.u_len;
|
||||||
int r = upx_decompress(in, ph.c_len, out, &new_len, ph.method, &ph.compress_result);
|
int r = upx_decompress(in, ph.c_len, out, &new_len, ph.method, &ph.compress_result);
|
||||||
if (r == UPX_E_OUT_OF_MEMORY)
|
if (r == UPX_E_OUT_OF_MEMORY)
|
||||||
|
|||||||
Reference in New Issue
Block a user