diff options
| author | Vincent Richard <[email protected]> | 2015-01-14 18:31:31 +0000 |
|---|---|---|
| committer | Vincent Richard <[email protected]> | 2015-01-14 18:31:31 +0000 |
| commit | 5e4bca3747b36a78d21fbc3c6d056f05b4ad2c98 (patch) | |
| tree | 876d7e3b65eeabe78eb398b6e6bb17d74df7eb4b /src | |
| parent | Fixed possible memory leak. (diff) | |
| download | vmime-5e4bca3747b36a78d21fbc3c6d056f05b4ad2c98.tar.gz vmime-5e4bca3747b36a78d21fbc3c6d056f05b4ad2c98.zip | |
Stop decoding when there are no more input bytes.
Diffstat (limited to 'src')
| -rw-r--r-- | src/vmime/utility/encoder/b64Encoder.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vmime/utility/encoder/b64Encoder.cpp b/src/vmime/utility/encoder/b64Encoder.cpp index 274c23c0..ddaa62f8 100644 --- a/src/vmime/utility/encoder/b64Encoder.cpp +++ b/src/vmime/utility/encoder/b64Encoder.cpp @@ -258,6 +258,9 @@ size_t b64Encoder::decode(utility::inputStream& in, } } + if (count != 4) // input length is not a multiple of 4 bytes + break; + // Decode the bytes byte_t c1 = bytes[0]; byte_t c2 = bytes[1]; |
