[CP] fix change user read packet out of bound
This commit is contained in:
@ -64,7 +64,8 @@ int ObMPChangeUser::deserialize()
|
||||
pkt_ = reinterpret_cast<const ObMySQLRawPacket&>(req_->get_packet());
|
||||
const char *buf = pkt_.get_cdata();
|
||||
const char *pos = pkt_.get_cdata();
|
||||
const int64_t len = pkt_.get_clen();
|
||||
// need skip command byte
|
||||
const int64_t len = pkt_.get_clen() - 1;
|
||||
const char *end = buf + len;
|
||||
|
||||
if (OB_LIKELY(pos < end)) {
|
||||
@ -337,6 +338,8 @@ int ObMPChangeUser::load_privilege_info(ObSQLSessionInfo *session)
|
||||
OB_LOG(WARN, "fail to set tenant", "tenant name", login_info.tenant_name_, K(ret));
|
||||
} else if (OB_FAIL(session->set_default_database(database_))) {
|
||||
OB_LOG(WARN, "failed to set default database", K(ret), K(database_));
|
||||
} else if (OB_FAIL(session->set_real_client_ip(login_info.client_ip_))) {
|
||||
LOG_WARN("failed to set_real_client_ip", K(ret));
|
||||
} else if (OB_FAIL(session->load_default_sys_variable(false, true))) {
|
||||
LOG_WARN("failed to load system variables", K(ret));
|
||||
} else if (OB_FAIL(session->update_database_variables(&schema_guard))) {
|
||||
|
||||
Reference in New Issue
Block a user