Fix invalid read-after-free for 'account_details.attributes'

This ownership model needs to be revisited. After transferring the
ownership of an 'account_details_t' field, it should be nullified.
v2.x_pg_PrepStmtBase_240714
Javier Jaramago Fernández 2 years ago
parent badcaefe65
commit ff8d8b1125

@ -1415,6 +1415,7 @@ bool MySQL_Protocol::process_pkt_COM_CHANGE_USER(unsigned char *pkt, unsigned in
(*myds)->sess->user_attributes = nullptr;
}
(*myds)->sess->user_attributes=account_details.attributes;
account_details.attributes = nullptr;
char* password = get_password(account_details, PASSWORD_TYPE::PRIMARY);
if (password==NULL) {

Loading…
Cancel
Save