mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
check if second stream is zip header without changing position - fix
This commit is contained in:
@@ -41,9 +41,16 @@ public partial class ZipArchive : AbstractWritableArchive<ZipArchiveEntry, ZipVo
|
||||
var idx = 0;
|
||||
if (streams.Count() > 1)
|
||||
{
|
||||
streams[1].Position += 4;
|
||||
var isZip = IsZipFile(streams[1], ReaderOptions.Password, ReaderOptions.BufferSize);
|
||||
streams[1].Position -= 4;
|
||||
//check if second stream is zip header without changing position
|
||||
var headerProbeStream = streams[1];
|
||||
var startPosition = headerProbeStream.Position;
|
||||
headerProbeStream.Position = startPosition + 4;
|
||||
var isZip = IsZipFile(
|
||||
headerProbeStream,
|
||||
ReaderOptions.Password,
|
||||
ReaderOptions.BufferSize
|
||||
);
|
||||
headerProbeStream.Position = startPosition;
|
||||
if (isZip)
|
||||
{
|
||||
stream.IsVolumes = true;
|
||||
|
||||
Reference in New Issue
Block a user