Fix potentially getting incorrect offset to CD entry

This commit is contained in:
Timofey Solomko
2017-10-21 12:50:46 +03:00
parent 7779058406
commit 0cf736d844
+1 -1
View File
@@ -64,7 +64,7 @@ public class ZipContainer: Container {
// TODO: temporary
private static func getEntryData(_ pointerData: DataWithPointer, _ info: ZipEntryInfo) throws -> Data {
// Now, let's move to the location of local header.
pointerData.index = Int(UInt32(truncatingIfNeeded: info.cdEntry.offset))
pointerData.index = Int(info.cdEntry.offset)
let localHeader = try ZipLocalHeader(pointerData)
// Check local header for consistency with Central Directory entry.