You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is the test data, 29 short files, each deflated with zlib format (header 78-9C and Adler32 footer): https://www.dropbox.com/s/jrl5rmlx8idafm1/packets.zip?dl=0
First two of them are good, the remaining are bad (broken).
When inflating, some of the bad packets lead to an exception, but some other cause the ininite loop of endless repeated Inflate calls.
Steps to reproduce
Take, for instance, file packet-03 or packet-05.
Try to inflate the contents with Inflater.Inflate with a code like that:
var zbuf = File.ReadAllBytes("packet-03");
var zlib = new Inflater();
var buf = new byte[1460];
var ms = new MemoryStream();
zlib.SetInput(zbuf);
int n;
while ((n = zlib.Inflate(buf)) > 0)
{
ms.Write(buf, 0, n);
}
if (!zlib.IsFinished)
throw new InvalidOperationException("Inflater not finished!");
return ms.ToArray();
Expected behavior
There should be an exception while inflating.
Actual behavior
You'll get into an infinite loop of generating endless zero bytes.
Version of SharpZipLib
0.86.0.518
master on 2016-08-03
Obtained from (place an x between the brackets for all that apply)
Compiled from source
branch: master
commit: _______
Downloaded DLL from GitHub
Downloaded DLL from SourceForge
Downloaded DLL from _______
DLL included as part of
Package installed using:
NuGet
MyGet
Chocolatey
The text was updated successfully, but these errors were encountered:
Here is the test data, 29 short files, each deflated with zlib format (header 78-9C and Adler32 footer):
https://www.dropbox.com/s/jrl5rmlx8idafm1/packets.zip?dl=0
First two of them are good, the remaining are bad (broken).
When inflating, some of the bad packets lead to an exception, but some other cause the ininite loop of endless repeated Inflate calls.
Steps to reproduce
Expected behavior
There should be an exception while inflating.
Actual behavior
You'll get into an infinite loop of generating endless zero bytes.
Version of SharpZipLib
0.86.0.518
master on 2016-08-03
Obtained from (place an x between the brackets for all that apply)
The text was updated successfully, but these errors were encountered: