Check ph.c_len; CERT-FI 829767
id:000010,sig:06,src:000000,op:flip1,pos:11584
This commit is contained in:
+1
-1
@@ -1294,7 +1294,7 @@ void PackMachBase<T>::unpack(OutputFile *fo)
|
|||||||
fi->readx(&bhdr, sizeof(bhdr));
|
fi->readx(&bhdr, sizeof(bhdr));
|
||||||
ph.u_len = get_te32(&bhdr.sz_unc);
|
ph.u_len = get_te32(&bhdr.sz_unc);
|
||||||
ph.c_len = get_te32(&bhdr.sz_cpr);
|
ph.c_len = get_te32(&bhdr.sz_cpr);
|
||||||
if (file_size < ph.c_len)
|
if (file_size < ph.c_len || ph.c_len == 0 || ph.u_len == 0)
|
||||||
throwCantUnpack("file header corrupted");
|
throwCantUnpack("file header corrupted");
|
||||||
ph.method = bhdr.b_method;
|
ph.method = bhdr.b_method;
|
||||||
ph.filter = bhdr.b_ftid;
|
ph.filter = bhdr.b_ftid;
|
||||||
|
|||||||
Reference in New Issue
Block a user