diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-07-15 23:36:16 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-07-15 23:36:16 +0700 |
commit | 7edbca353a0ba900c7f942797d72ca6b115d103a (patch) | |
tree | c23673424f03f1fe479c865ee7db4fd58b561348 /crypto/bzip2 | |
parent | Avoid redundant CheckUsageInRole calls (diff) | |
download | BouncyCastle.NET-ed25519-7edbca353a0ba900c7f942797d72ca6b115d103a.tar.xz |
Fix bzip2 compression for empty contents
- see https://github.com/bcgit/bc-java/issues/993
Diffstat (limited to 'crypto/bzip2')
-rw-r--r-- | crypto/bzip2/src/CBZip2OutputStream.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/bzip2/src/CBZip2OutputStream.cs b/crypto/bzip2/src/CBZip2OutputStream.cs index ffac073fb..6e9d86bba 100644 --- a/crypto/bzip2/src/CBZip2OutputStream.cs +++ b/crypto/bzip2/src/CBZip2OutputStream.cs @@ -423,7 +423,10 @@ namespace Org.BouncyCastle.Apache.Bzip2 WriteRun(); } currentChar = -1; - EndBlock(); + if (last >= 0) + { + EndBlock(); + } EndCompression(); finished = true; Flush(); |