From 98383f2bedb08321e857eb2f3de6e11fc6d4d9ff Mon Sep 17 00:00:00 2001 From: Timofey Solomko Date: Sun, 9 Jul 2017 13:02:42 +0300 Subject: [PATCH] Fix problem with reading zip64 data descriptor --- Sources/ZipEntry.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/ZipEntry.swift b/Sources/ZipEntry.swift index 2be0c66c..da6123df 100644 --- a/Sources/ZipEntry.swift +++ b/Sources/ZipEntry.swift @@ -139,9 +139,9 @@ public class ZipEntry: ContainerEntry { } // Now, let's update from CD with values from data descriptor. crc32 = bitReader.uint32() - let sizeOfSizeField: UInt32 = localHeader!.zip64FieldsArePresent ? 8 : 4 - compSize = Int(bitReader.uint32(count: sizeOfSizeField)) - uncompSize = Int(bitReader.uint32(count: sizeOfSizeField)) + let sizeOfSizeField: UInt64 = localHeader!.zip64FieldsArePresent ? 8 : 4 + compSize = Int(bitReader.uint64(count: sizeOfSizeField)) + uncompSize = Int(bitReader.uint64(count: sizeOfSizeField)) } guard compSize == realCompSize && uncompSize == fileBytes.count