From f6a22e7da26314b38bf9befce34ae8e4b2543090 Mon Sep 17 00:00:00 2001 From: Thomas Zoechling Date: Tue, 20 Sep 2022 22:36:20 +0200 Subject: [PATCH] Fix logic error in checksum validation codepath --- Sources/ZIPFoundation/FileManager+ZIP.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/ZIPFoundation/FileManager+ZIP.swift b/Sources/ZIPFoundation/FileManager+ZIP.swift index b14d22d3..17fcb2d7 100644 --- a/Sources/ZIPFoundation/FileManager+ZIP.swift +++ b/Sources/ZIPFoundation/FileManager+ZIP.swift @@ -131,8 +131,7 @@ extension FileManager { } func verifyChecksumIfNecessary() throws { - guard skipCRC32 == false, crc32 == entry.checksum - else { + if skipCRC32 == false, crc32 != entry.checksum { throw Archive.ArchiveError.invalidCRC32 } }