mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Fix UB in LimitReadBuffer in case of unexpected EOF
Fixes the following possible assertions: - ./src/IO/ReadBuffer.h:58: bool DB::ReadBuffer::next(): Assertion `!hasPendingData()' failed. - ./src/IO/LimitReadBuffer.cpp:17: virtual bool DB::LimitReadBuffer::nextImpl(): Assertion `position() >= in->position()' failed. Fixes: 02151_http_s_structure_set_eof
This commit is contained in:
parent
08ced87880
commit
4230f04f72
@ -29,7 +29,8 @@ bool LimitReadBuffer::nextImpl()
|
||||
|
||||
if (!in->next())
|
||||
{
|
||||
working_buffer = in->buffer();
|
||||
/// Clearing the buffer with existing data.
|
||||
set(in->position(), 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user