ArgumentOutOfRangeException on Zip expansion #143

Closed
opened 2026-01-29 22:07:19 +00:00 by claunia · 6 comments
Owner

Originally created by @dkekesi on GitHub (Nov 7, 2016).

I get the following exception when expanding a certain Zip archive:

System.ArgumentOutOfRangeException: Stream length must be non-negative and less than 2^31 - 1 - origin.
Parameter name: value
at System.IO.MemoryStream.set_Position(Int64 value)
at SharpCompress.Common.Zip.ZipHeaderFactory.ReadHeader(UInt32 headerBytes, BinaryReader reader)
at SharpCompress.Common.Zip.SeekableZipHeaderFactory.GetLocalHeader(Stream stream, DirectoryEntryHeader directoryEntryHeader)
at SharpCompress.Common.Zip.SeekableZipFilePart.LoadLocalHeader()
at SharpCompress.Common.Zip.SeekableZipFilePart.GetCompressedStream()
at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry archiveEntry, Stream streamToWriteTo)

Can you look into what the problem may be? Other programs can expand the Zip. The file itself is merely 300K in size.
Thanks.

Originally created by @dkekesi on GitHub (Nov 7, 2016). I get the following exception when expanding a certain Zip archive: System.ArgumentOutOfRangeException: Stream length must be non-negative and less than 2^31 - 1 - origin. Parameter name: value at System.IO.MemoryStream.set_Position(Int64 value) at SharpCompress.Common.Zip.ZipHeaderFactory.ReadHeader(UInt32 headerBytes, BinaryReader reader) at SharpCompress.Common.Zip.SeekableZipHeaderFactory.GetLocalHeader(Stream stream, DirectoryEntryHeader directoryEntryHeader) at SharpCompress.Common.Zip.SeekableZipFilePart.LoadLocalHeader() at SharpCompress.Common.Zip.SeekableZipFilePart.GetCompressedStream() at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry archiveEntry, Stream streamToWriteTo) Can you look into what the problem may be? Other programs can expand the Zip. The file itself is merely 300K in size. Thanks.
Author
Owner

@adamhathcock commented on GitHub (Nov 8, 2016):

Need an example ZIP to see the problem really.

@adamhathcock commented on GitHub (Nov 8, 2016): Need an example ZIP to see the problem really.
Author
Owner

@dkekesi commented on GitHub (Nov 8, 2016):

The zip contains confidential information. Can you send me an email address where I can send the file to?

@dkekesi commented on GitHub (Nov 8, 2016): The zip contains confidential information. Can you send me an email address where I can send the file to?
Author
Owner

@dkekesi commented on GitHub (Apr 7, 2017):

Do you have any update on this? There are other files again with the same issue. If you can give me a mail address then I can send you the file.

@dkekesi commented on GitHub (Apr 7, 2017): Do you have any update on this? There are other files again with the same issue. If you can give me a mail address then I can send you the file.
Author
Owner

@adamhathcock commented on GitHub (Apr 8, 2017):

I haven't looked into this at all and likely won't soon. Sorry.

I assume other things actually do open this zip? DotNetZip ought to have he same issue. You could try the built in zip stuff in .NET

@adamhathcock commented on GitHub (Apr 8, 2017): I haven't looked into this at all and likely won't soon. Sorry. I assume other things actually do open this zip? DotNetZip ought to have he same issue. You could try the built in zip stuff in .NET
Author
Owner

@dkekesi commented on GitHub (Apr 8, 2017):

Heavy sigh... Thanks, anyway.

On 2017. 04. 08. 8:27, Adam Hathcock wrote:

  I haven't looked into this at all and likely won't soon. Sorry.
  I assume other things actually do open this zip? DotNetZip
    ought to have he same issue. You could try the built in zip
    stuff in .NET
  —
    You are receiving this because you authored the thread.
    Reply to this email directly, view
      it on GitHub, or mute
      the thread.
  
    
      
      
    
    
  
  {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/adamhathcock/sharpcompress","title":"adamhathcock/sharpcompress","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/adamhathcock/sharpcompress"}},"updates":{"snippets":[{"icon":"PERSON","message":"@adamhathcock in #194: I haven't looked into this at all and likely won't soon.  Sorry.\r\n\r\nI assume other things actually do open this zip?  DotNetZip ought to have he same issue.  You could try the built in zip stuff in .NET"}],"action":{"name":"View Issue","url":"https://github.com/adamhathcock/sharpcompress/issues/194#issuecomment-292698597"}}}
@dkekesi commented on GitHub (Apr 8, 2017): Heavy sigh... Thanks, anyway. On 2017. 04. 08. 8:27, Adam Hathcock wrote: I haven't looked into this at all and likely won't soon. Sorry. I assume other things actually do open this zip? DotNetZip ought to have he same issue. You could try the built in zip stuff in .NET — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread. {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/adamhathcock/sharpcompress","title":"adamhathcock/sharpcompress","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/adamhathcock/sharpcompress"}},"updates":{"snippets":[{"icon":"PERSON","message":"@adamhathcock in #194: I haven't looked into this at all and likely won't soon. Sorry.\r\n\r\nI assume other things actually do open this zip? DotNetZip ought to have he same issue. You could try the built in zip stuff in .NET"}],"action":{"name":"View Issue","url":"https://github.com/adamhathcock/sharpcompress/issues/194#issuecomment-292698597"}}}
Author
Owner

@dkekesi commented on GitHub (Jun 10, 2017):

It seems that version 0.17.1 can cope with the problematic file. I think this case can be closed.

@dkekesi commented on GitHub (Jun 10, 2017): It seems that version 0.17.1 can cope with the problematic file. I think this case can be closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#143