summaryrefslogtreecommitdiff
path: root/zen/serialize.h
diff options
context:
space:
mode:
Diffstat (limited to 'zen/serialize.h')
-rwxr-xr-xzen/serialize.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/zen/serialize.h b/zen/serialize.h
index bb2f7a45..c8dfb96d 100755
--- a/zen/serialize.h
+++ b/zen/serialize.h
@@ -241,6 +241,7 @@ template <class BufferedInputStream> inline
void readArray(BufferedInputStream& stream, void* buffer, size_t len) //throw UnexpectedEndOfStreamError
{
const size_t bytesRead = stream.read(buffer, len);
+ assert(bytesRead <= len); //buffer overflow otherwise not always detected!
if (bytesRead < len)
throw UnexpectedEndOfStreamError();
}
bgstack15