diff --git a/doc/Changes.txt b/doc/Changes.txt index ad8d1126b..e7a4b45b0 100644 --- a/doc/Changes.txt +++ b/doc/Changes.txt @@ -1,3 +1,21 @@ +Changes for 0.86.0 ++ Multi-member gzip files are now supported. Contributed by Geoff Hart. ++ Zero byte files caused ZipOutputStream to create invalid zipfiles. Contributed by Mark Ritchie. ++ ZipFile.CommitUpdate failed on ODT (Open Document) files when updating in memory. Contributed by Dricks. ++ Exceptions occurring within ZipFile.CommitUpdate were being silently discarded. ++ In FastZip, the NameFilter erroneously removed all escapes from regex. Contributed by John Lemberger. + Note: This is a breaking change - if you had detoured this filter bug via doubled-up backslashes, + please halve them - for example change @"\\\\myextract.txt$" to @"\\myextract.txt$", or + change "\\\\\\\\myextract.txt$" to "\\\\myextract.txt$". ++ AES Encryption and Decryption is now supported. ++ TarArchive now has IsStreamOwner property, for use with MemoryStream. ++ Removed exception "Extra data contains Zip64 information but version 2.0 is not high enough" due to rogue zip creators. ++ FastZip.ExtractZip now accepts an Input Stream. ++ Zip input and output streams can now specify buffer sizes. ++ Solved "NTFS Extra data invalid" exception when reading zip files with zero-length NTFS ExtraData entry. ++ Fixed "Size mismatch" exceptions reading zips created by SharpZipLib with an explicit entry CRC and Size. + + Changes for 0.85.5 + Fix for unreferenced ZipFile causing read failure after garbage collection. + Fix to ZipInputStream.CloseEntry were skipping could fail for long values. diff --git a/src/AssemblyInfo.cs b/src/AssemblyInfo.cs index 929b3e118..2fed2b112 100644 --- a/src/AssemblyInfo.cs +++ b/src/AssemblyInfo.cs @@ -77,7 +77,7 @@ [assembly: AssemblyCopyright("Copyright 2001-2010 Mike Krueger, John Reilly")] [assembly: AssemblyTrademark("Copyright 2001-2010 Mike Krueger, John Reilly")] -[assembly: AssemblyVersion("0.86.0.516")] +[assembly: AssemblyVersion("0.86.0.518")] [assembly: AssemblyInformationalVersionAttribute("0.86.0")] diff --git a/src/Zip/ZipFile.cs b/src/Zip/ZipFile.cs index dee6e9427..af4000b25 100644 --- a/src/Zip/ZipFile.cs +++ b/src/Zip/ZipFile.cs @@ -40,6 +40,7 @@ // HISTORY // 2009-12-22 Z-1649 Added AES support // 2010-03-02 Z-1650 Fixed updating ODT archives in memory. Exposed exceptions in updating. +// 2010-05-25 Z-1663 Fixed exception when testing local header compressed size of -1 using System; using System.Collections; @@ -1255,7 +1256,8 @@ long TestLocalHeader(ZipEntry entry, HeaderTest tests) entry.Size, size)); } - if (compressedSize != entry.CompressedSize) { + if (compressedSize != entry.CompressedSize && + compressedSize != 0xFFFFFFFF && compressedSize != -1) { throw new ZipException( string.Format("Compressed size mismatch between central header({0}) and local header({1})", entry.CompressedSize, compressedSize)); diff --git a/src/Zip/ZipInputStream.cs b/src/Zip/ZipInputStream.cs index 8ad7ccd33..b481ea164 100644 --- a/src/Zip/ZipInputStream.cs +++ b/src/Zip/ZipInputStream.cs @@ -37,8 +37,10 @@ // obligated to do so. If you do not wish to do so, delete this // exception statement from your version. +// HISTORY +// 2010-05-25 Z-1663 Fixed exception when testing local header compressed size of -1 + using System; -using System.Text; using System.IO; using ICSharpCode.SharpZipLib.Checksums; @@ -613,8 +615,10 @@ int BodyRead(byte[] buffer, int offset, int count) throw new ZipException("Inflater not finished!"); } inputBuffer.Available = inf.RemainingInput; - - if ((flags & 8) == 0 && (inf.TotalIn != csize || inf.TotalOut != size)) { + + // A csize of -1 is from an unpatched local header + if ((flags & 8) == 0 && + (inf.TotalIn != csize && csize != 0xFFFFFFFF && csize != -1 || inf.TotalOut != size)) { throw new ZipException("Size mismatch: " + csize + ";" + size + " <-> " + inf.TotalIn + ";" + inf.TotalOut); } inf.Reset();