MXS-3054: Fix crash on malformed mapping reply
The code used a null GWBUF with gwbuf_append which causes a crash. The return value of the function that used it was also not correctly handled and would be mistaken for a different error.
This commit is contained in:
parent
608eb95284
commit
7ad3485892
@ -1024,6 +1024,10 @@ int SchemaRouterSession::inspect_mapping_states(SSRBackend& bref,
|
||||
(*it)->backend()->server->name(),
|
||||
m_client->session);
|
||||
}
|
||||
else if (rc == SHOWDB_FATAL_ERROR)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mxb_assert(rc != SHOWDB_PARTIAL_RESPONSE);
|
||||
@ -1279,7 +1283,7 @@ enum showdb_response SchemaRouterSession::parse_mapping_response(SSRBackend& bre
|
||||
if (ptr >= (uint8_t*) buf->end)
|
||||
{
|
||||
MXS_INFO("Malformed packet for mapping query.");
|
||||
*buffer = gwbuf_append(buf, *buffer);
|
||||
gwbuf_free(buf);
|
||||
return SHOWDB_FATAL_ERROR;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user