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

Check ph.c_len; CERT-FI 829767

id:000023,sig:06,src:000000,op:flip2,pos:10440
This commit is contained in:
John Reiser 2015-05-09 07:18:54 -07:00
parent 52f9ef14b9
commit 2cb7b56a41

View File

@ -3022,7 +3022,7 @@ void PackLinuxElf64::unpack(OutputFile *fo)
fi->readx(&bhdr, szb_info);
ph.u_len = get_te32(&bhdr.sz_unc);
ph.c_len = get_te32(&bhdr.sz_cpr);
if (ph.c_len > fi->st_size())
if (ph.c_len > fi->st_size() || ph.c_len == 0 || ph.u_len == 0)
throwCantUnpack("file header corrupted");
ph.filter_cto = bhdr.b_cto8;