Skip to content

Commit ae622a8

Browse files
author
David Pierson
committed
Z-1648 Zero byte entries would create invalid zip files
1 parent a66a569 commit ae622a8

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/Zip/ZipOutputStream.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
// exception statement from your version.
3939

4040
// HISTORY
41-
// 22-12-2009 DavidPierson Added AES support
41+
// 22-12-2009 Z-1649 Added AES support
42+
// 22-02-2010 Z-1648 Zero byte entries would create invalid zip files
4243

4344
using System;
4445
using System.IO;
@@ -473,7 +474,7 @@ public void CloseEntry()
473474

474475
// First finish the deflater, if appropriate
475476
if (curMethod == CompressionMethod.Deflated) {
476-
if (size > 0) {
477+
if (size >= 0) {
477478
base.Finish();
478479
csize = deflater_.TotalOut;
479480
}

0 commit comments

Comments
 (0)