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];