Added CRYPTOPP_ASSERT to SafeConvert result because FileSink::Put2 does not throw. Maybe Put2 should work with std::streamsize::max() size blocks

This commit is contained in:
Jeffrey Walton 2015-07-30 02:37:59 -04:00
parent 978b7149f2
commit 9d579ad208

View File

@ -239,7 +239,9 @@ size_t FileSink::Put2(const byte *inString, size_t length, int messageEnd, bool
while (length > 0)
{
std::streamsize size;
if (!SafeConvert(length, size))
bool safe = SafeConvert(length, size);
CRYPTOPP_ASSERT(safe);
if (!safe)
size = numeric_limits<std::streamsize>::max();
m_stream->write((const char *)inString, size);
inString += size;