Stop decoding when there are no more input bytes.

This commit is contained in:
Vincent Richard 2015-01-14 19:31:31 +01:00
parent 8d46091533
commit 5e4bca3747

View File

@ -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 // Decode the bytes
byte_t c1 = bytes[0]; byte_t c1 = bytes[0];
byte_t c2 = bytes[1]; byte_t c2 = bytes[1];