summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--files.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/files.cpp b/files.cpp
index 01b0c5ed..252eee00 100644
--- a/files.cpp
+++ b/files.cpp
@@ -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;