vici: Check if header has been received before processing an empty message
If do_read() returns with EWOULDBLOCK, we must ensure that we actually have processed the full length header before checking the zero-initialized buffer length.
This commit is contained in:
@@ -514,7 +514,8 @@ CALLBACK(on_read, bool,
|
||||
{
|
||||
disconnect(this, entry->id);
|
||||
}
|
||||
else if (entry->in.buf.len == entry->in.done)
|
||||
else if (entry->in.hdrlen == sizeof(entry->in.hdr) &&
|
||||
entry->in.buf.len == entry->in.done)
|
||||
{
|
||||
array_insert(entry->queue, ARRAY_TAIL, &entry->in.buf);
|
||||
entry->in.buf = chunk_empty;
|
||||
|
||||
Reference in New Issue
Block a user