MXS-870: Handle non-contiguous session command responses

Session command responses with multiple packets could be spread across
multiple, non-contiguous buffers. If a buffer contained a complete packet
and some extra data but it wasn't contiguous, the debug assertion in
gwbuf_clone_portion would fail. With release builds, it would cause
eventual out-of-bounds memory access when the response would be sent to
the client.
This commit is contained in:
Markus Makela
2016-09-19 05:34:03 +03:00
parent 7fc7249349
commit 92ef33327e
4 changed files with 12 additions and 27 deletions

View File

@ -384,9 +384,9 @@ GWBUF* gwbuf_clone_all(GWBUF* buf)
}
GWBUF *gwbuf_clone_portion(GWBUF *buf,
size_t start_offset,
size_t length)
static GWBUF *gwbuf_clone_portion(GWBUF *buf,
size_t start_offset,
size_t length)
{
GWBUF* clonebuf;