diff options
-rw-r--r-- | src/streams.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/streams.h b/src/streams.h index 0fc6135a6a..a50fe4e859 100644 --- a/src/streams.h +++ b/src/streams.h @@ -240,7 +240,9 @@ public: CDataStream& ignore(int nSize) { // Ignore from the beginning of the buffer - assert(nSize >= 0); + if (nSize < 0) { + throw std::ios_base::failure("CDataStream::ignore(): nSize negative"); + } unsigned int nReadPosNext = nReadPos + nSize; if (nReadPosNext >= vch.size()) { |