Skip to content

Exception thrown when updating a large (5GB) zip file #267

@zpst

Description

@zpst

Steps to reproduce

  1. Create a zip file (with SharpZipLib) with approx. 5 GB
  2. Open the zip file (5 GB) as a FileStream
  3. Open the file to be added (572 MB) as a FileStream
  4. Call the methode UpdateZipInMemory https://github.com/icsharpcode/SharpZipLib/wiki/Updating

My modified method

      public void CallingExample()
      {
         FileStream fs = File.Open(@"c:\temp\existing.zip", FileMode.Open, FileAccess.ReadWrite);
         FileStream fsEntry = File.OpenRead(@"c:\temp\test1.zip");

         // Do the update
         UpdateZipInMemory(fs, fsEntry, "test1.zip");
         fsEntry.Close();

         fs.Close();
      }

Expected behavior

File is added to the zip archive.

Actual behavior

Exception is thrown
ICSharpCode.SharpZipLib.Zip.ZipException: "End of extra data"

ICSharpCode.SharpZipLib.dll!ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadCheck(int length)
ICSharpCode.SharpZipLib.dll!ICSharpCode.SharpZipLib.Zip.ZipExtraData.ReadLong()
ICSharpCode.SharpZipLib.dll!ICSharpCode.SharpZipLib.Zip.ZipEntry.ProcessExtraData(bool localHeader)
ICSharpCode.SharpZipLib.dll!ICSharpCode.SharpZipLib.Zip.ZipFile.ReadEntries()
ICSharpCode.SharpZipLib.dll!ICSharpCode.SharpZipLib.Zip.ZipFile.RunUpdates()
ICSharpCode.SharpZipLib.dll!ICSharpCode.SharpZipLib.Zip.ZipFile.CommitUpdate()

Version of SharpZipLib

  • v1.0.0
  • v1.0.0 RC2
  • 0.86.0.518

Obtained from (place an x between the brackets for all that apply)

  • Compiled from source
    • Source code (.zip) v1.0.0 and v1.0.0 RC2
  • Downloaded DLL from GitHub (0.86.0.518)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions