You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ZIP_CHECKCONS reports wrong failures for stored, encrypted entries.
This happens because encryption adds extra bytes to the compressed size which zip_dirent_check_consistency() (GIT main at the time of this writing) does not take into account.
Here is a proposed fix:
intzip_dirent_check_consistency(zip_dirent_t*dirent) {
if (dirent->comp_method==ZIP_CM_STORE)
switch (dirent->encryption_method) {
caseZIP_EM_NONE:
if (dirent->comp_size!=dirent->uncomp_size)
returnZIP_ER_DETAIL_STORED_SIZE_MISMATCH;
break;
caseZIP_EM_TRAD_PKWARE:
if (dirent->comp_size!=dirent->uncomp_size+12)
returnZIP_ER_DETAIL_STORED_SIZE_MISMATCH;
break;
caseZIP_EM_AES_128:
if (dirent->comp_size!=dirent->uncomp_size+20)
returnZIP_ER_DETAIL_STORED_SIZE_MISMATCH;
break;
caseZIP_EM_AES_192:
if (dirent->comp_size!=dirent->uncomp_size+24)
returnZIP_ER_DETAIL_STORED_SIZE_MISMATCH;
break;
caseZIP_EM_AES_256:
if (dirent->comp_size!=dirent->uncomp_size+28)
returnZIP_ER_DETAIL_STORED_SIZE_MISMATCH;
break;
}
return0;
}
The text was updated successfully, but these errors were encountered:
ZIP_CHECKCONS
reports wrong failures for stored, encrypted entries.This happens because encryption adds extra bytes to the compressed size which
zip_dirent_check_consistency()
(GIT main at the time of this writing) does not take into account.Here is a proposed fix:
The text was updated successfully, but these errors were encountered: