diff --git a/Sources/GZip/GzipArchive.swift b/Sources/GZip/GzipArchive.swift index 7a840402..0cafe099 100644 --- a/Sources/GZip/GzipArchive.swift +++ b/Sources/GZip/GzipArchive.swift @@ -77,8 +77,9 @@ public class GzipArchive: Archive { } private static func processMember(_ bitReader: LsbBitReader) throws -> Member { - // Valid GZip archive must contain at least 18 bytes of data (10 for header and 8 for checksums). - guard bitReader.bitsLeft >= 18 * 8 + // Valid GZip archive must contain at least 20 bytes of data (10 for the header, 2 for an empty Deflate block, + // and 8 for checksums). + guard bitReader.bitsLeft >= 20 * 8 else { throw GzipError.wrongMagic } let header = try GzipHeader(bitReader)