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

Commit 1c7cf90a authored by Kenny Root's avatar Kenny Root
Browse files

Fix another off-by-one error in ZipFileRO

Bug: 10424836
Change-Id: I491458bd31ef39e87127d061427b32a3d59ac807
parent d292f790
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -645,7 +645,7 @@ bool ZipFileRO::getEntryInfo(ZipEntryRO entry, int* pMethod, size_t* pUncompLen,


        if (method == kCompressStored &&
        if (method == kCompressStored &&
            ((dataOffset >= cdOffset) ||
            ((dataOffset >= cdOffset) ||
             (uncompLen >= (cdOffset - dataOffset))))
             (uncompLen > (cdOffset - dataOffset))))
        {
        {
            ALOGE("ERROR: bad uncompressed length in zip (%ld + " ZD " > %ld)\n",
            ALOGE("ERROR: bad uncompressed length in zip (%ld + " ZD " > %ld)\n",
                (long) dataOffset, (ZD_TYPE) uncompLen, (long) cdOffset);
                (long) dataOffset, (ZD_TYPE) uncompLen, (long) cdOffset);