Skip to content
Snippets Groups Projects
Commit 7ad65d07 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Iproto padding check: we must check for length after all.

Check for length, since otherwise the server would randomly
drop client connection once in a while.
parent 287722b3
No related branches found
No related tags found
No related merge requests found
......@@ -477,9 +477,10 @@ iproto_enqueue_batch(struct iproto_connection *con, struct ibuf *in)
break;
uint32_t len = mp_decode_uint(&pos);
/* Skip optional request padding. */
if (mp_typeof(*pos) == MP_STR && mp_check(&pos, in->end))
if (pos < in->end && mp_typeof(*pos) == MP_STR &&
mp_check(&pos, in->end)) {
goto error;
}
const char *reqend = pos + len;
if (reqend > in->end)
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment