Check that position doesn't go beyond end (#20039)

This commit is contained in:
Ivan 2021-02-05 01:21:24 +03:00 committed by GitHub
parent 91ea99129e
commit 0db2aa3c2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,6 +55,8 @@ public:
*/
bool next()
{
assert(position() <= working_buffer.end());
bytes += offset();
bool res = nextImpl();
if (!res)
@ -62,6 +64,9 @@ public:
pos = working_buffer.begin() + nextimpl_working_buffer_offset;
nextimpl_working_buffer_offset = 0;
assert(position() <= working_buffer.end());
return res;
}