Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix parsing of "version needed to extract" field

This field consists of two bytes, upper one indicating host OS and lower one
indicating version of Zip (de)compressor. Tomake sure if one can unpack given
archive it's only lower byte which is needed to be checked, but library used
to check both.
  • Loading branch information...
commit 3013f62f9654f74880eb25f1fa3d59b57ca2acce 1 parent 3fa6c7b
@Minoru Minoru authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  Codec/Archive/Zip.hs
3  Codec/Archive/Zip.hs
@@ -578,7 +578,8 @@ getFileHeader locals = do
else do
skip 4 -- skip past signature
skip 2 -- version made by
- versionNeededToExtract <- getWord16le
+ versionNeededToExtract <- getWord8
+ skip 1 -- upper byte indicates OS part of "version needed to extract"
unless (versionNeededToExtract <= 20) $
fail "This archive requires zip >= 2.0 to extract."
skip 2 -- general purpose bit flag
Please sign in to comment.
Something went wrong with that request. Please try again.