Steps to reproduce
- Create a 0-byte file on the disk.
- Try to zip it using code like this:
FileStream ostream = File.OpenRead(file);
obuffer = new byte[ostream.Length];
ostream.Read(obuffer, 0, obuffer.Length);
zipOutputStream.Write(obuffer, 0, obuffer.Length);
Expected behavior
The file should be added successfully to the zip stream.
Actual behavior
A CRC32 error is thrown ("not a valid index into buffer").
Workaround
Prevent writing into the archive stream the empty file, e.g.
if (obuffer.Length > 0)
zipOutputStream.Write(obuffer, 0, obuffer.Length);
Version of SharpZipLib
Obtained from (place an x between the brackets for all that apply)
Steps to reproduce
Expected behavior
The file should be added successfully to the zip stream.
Actual behavior
A CRC32 error is thrown ("not a valid index into buffer").
Workaround
Prevent writing into the archive stream the empty file, e.g.
Version of SharpZipLib
Obtained from (place an x between the brackets for all that apply)