From 8ec3e47283b2c201474f731a52b8c752c5127e2e Mon Sep 17 00:00:00 2001 From: novn2013 Date: Wed, 23 Jul 2014 01:48:53 +0800 Subject: [PATCH 1/2] Update ZipFile.cs Correct the zip specification version by only checking the lower bits. --- src/Zip/ZipFile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Zip/ZipFile.cs b/src/Zip/ZipFile.cs index 814d9bdab..b1f8b6c07 100644 --- a/src/Zip/ZipFile.cs +++ b/src/Zip/ZipFile.cs @@ -1023,7 +1023,7 @@ long TestLocalHeader(ZipEntry entry, HeaderTest tests) throw new ZipException(string.Format("Wrong local header signature @{0:X}", offsetOfFirstEntry + entry.Offset)); } - short extractVersion = ( short )ReadLEUshort(); + short extractVersion = ( short )ReadLEUshort() & 0x00ff; short localFlags = ( short )ReadLEUshort(); short compressionMethod = ( short )ReadLEUshort(); short fileTime = ( short )ReadLEUshort(); From d98d18e14630b7d709b87d03c401d9376fce7ab6 Mon Sep 17 00:00:00 2001 From: novn2013 Date: Wed, 23 Jul 2014 03:02:37 +0800 Subject: [PATCH 2/2] Update ZipFile.cs --- src/Zip/ZipFile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Zip/ZipFile.cs b/src/Zip/ZipFile.cs index b1f8b6c07..d2bdb420a 100644 --- a/src/Zip/ZipFile.cs +++ b/src/Zip/ZipFile.cs @@ -1023,7 +1023,7 @@ long TestLocalHeader(ZipEntry entry, HeaderTest tests) throw new ZipException(string.Format("Wrong local header signature @{0:X}", offsetOfFirstEntry + entry.Offset)); } - short extractVersion = ( short )ReadLEUshort() & 0x00ff; + short extractVersion = ( short ) (ReadLEUshort() & 0x00ff); short localFlags = ( short )ReadLEUshort(); short compressionMethod = ( short )ReadLEUshort(); short fileTime = ( short )ReadLEUshort();