Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa34861b authored by Alex Klyubin's avatar Alex Klyubin Committed by android-build-merger
Browse files

Merge "Permit 65535 byte ZIP comments and empty Central Directory" am:...

Merge "Permit 65535 byte ZIP comments and empty Central Directory" am: f420b91e am: be81b50b am: e1bc3322
am: 9c280d15

Change-Id: I45452e71df0779b69b77e2dd1691a6fa27868e74
parents 74dfc6b1 9c280d15
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -579,7 +579,7 @@ public class ApkSignatureSchemeV2Verifier {
            throws SignatureNotFoundException {
        // Look up the offset of ZIP Central Directory.
        long centralDirOffset = ZipUtils.getZipEocdCentralDirectoryOffset(eocd);
        if (centralDirOffset >= eocdOffset) {
        if (centralDirOffset > eocdOffset) {
            throw new SignatureNotFoundException(
                    "ZIP Central Directory offset out of range: " + centralDirOffset
                    + ". ZIP End of Central Directory offset: " + eocdOffset);
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@ abstract class ZipUtils {
        }
        int maxCommentLength = Math.min(archiveSize - ZIP_EOCD_REC_MIN_SIZE, UINT16_MAX_VALUE);
        int eocdWithEmptyCommentStartPosition = archiveSize - ZIP_EOCD_REC_MIN_SIZE;
        for (int expectedCommentLength = 0; expectedCommentLength < maxCommentLength;
        for (int expectedCommentLength = 0; expectedCommentLength <= maxCommentLength;
                expectedCommentLength++) {
            int eocdStartPos = eocdWithEmptyCommentStartPosition - expectedCommentLength;
            if (zipContents.getInt(eocdStartPos) == ZIP_EOCD_REC_SIG) {