diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-06-20 04:48:05 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-06-20 04:48:05 +0000 |
commit | 224010546f03cff20e3622de9cbb609c31273e75 (patch) | |
tree | beaf073a7afe7b8ccaa76f000e81d1c3c6b52dab /src | |
parent | ec105b8379b44d7192001e55f87fd1d7aa17532a (diff) | |
download | libbu++-224010546f03cff20e3622de9cbb609c31273e75.tar.gz libbu++-224010546f03cff20e3622de9cbb609c31273e75.tar.bz2 libbu++-224010546f03cff20e3622de9cbb609c31273e75.tar.xz libbu++-224010546f03cff20e3622de9cbb609c31273e75.zip |
Whew, the cipher was writing blocks at close when no data had been written yet.
It only caused a problem when you stopped part way through reading something.
Diffstat (limited to '')
-rw-r--r-- | src/experimental/cipher.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/experimental/cipher.h b/src/experimental/cipher.h index 91f1704..74f5124 100644 --- a/src/experimental/cipher.h +++ b/src/experimental/cipher.h | |||
@@ -98,7 +98,7 @@ namespace Bu | |||
98 | 98 | ||
99 | virtual void flush() | 99 | virtual void flush() |
100 | { | 100 | { |
101 | if( iWriteBufFill < iBlockSize ) | 101 | if( iWriteBufFill > 0 && iWriteBufFill < iBlockSize ) |
102 | { | 102 | { |
103 | memset( aWriteBuf+iWriteBufFill, 0, iBlockSize-iWriteBufFill ); | 103 | memset( aWriteBuf+iWriteBufFill, 0, iBlockSize-iWriteBufFill ); |
104 | encipher( aWriteBuf ); | 104 | encipher( aWriteBuf ); |