Commit 7e56e9ea authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-13650 Backport fix for MDEV-13060 (crash when both AWS plugin and...

MDEV-13650 Backport fix for MDEV-13060 (crash when both AWS plugin and server_audit are loaded) to 10.1

MDEV-13060 Server Audit Plugin Crashes with AWS KMS plugin

don't do auditing if thd is NULL.

Collaterals:
* copy-paste bugs server_audit.c
parent df24f846
......@@ -1145,7 +1145,7 @@ static void setup_connection_initdb(struct connection_info *cn,
}
else
{
get_str_n(cn->user, &cn->user_length, sizeof(cn->db),
get_str_n(cn->user, &cn->user_length, sizeof(cn->user),
uh_buffer, user_len);
get_str_n(cn->host, &cn->host_length, sizeof(cn->host),
uh_buffer+user_len+1, host_len);
......@@ -1196,7 +1196,7 @@ static void setup_connection_query(struct connection_info *cn,
}
else
{
get_str_n(cn->user, &cn->user_length, sizeof(cn->db),
get_str_n(cn->user, &cn->user_length, sizeof(cn->user),
uh_buffer, user_len);
get_str_n(cn->host, &cn->host_length, sizeof(cn->host),
uh_buffer+user_len+1, host_len);
......@@ -1956,7 +1956,7 @@ void auditing(MYSQL_THD thd, unsigned int event_class, const void *ev)
/* That one is important as this function can be called with */
/* &lock_operations locked when the server logs an error reported */
/* by this plugin. */
if (internal_stop_logging)
if (!thd || internal_stop_logging)
return;
flogger_mutex_lock(&lock_operations);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment