summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-06-26 20:06:12 +0200
committerSergei Golubchik <serg@mariadb.org>2017-09-18 10:40:26 +0200
commit7e56e9ea774a8f7e6e2f0327e8f16d1c3c0f5be9 (patch)
tree8c50e24a95bb5771a932cdcf7ad9ec2d1d4602a2 /plugin
parentdf24f8469d31cc7eb33b4446e1450b95c12e0122 (diff)
downloadmariadb-git-7e56e9ea774a8f7e6e2f0327e8f16d1c3c0f5be9.tar.gz
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
Diffstat (limited to 'plugin')
-rw-r--r--plugin/server_audit/server_audit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c
index e9827b90402..b2785b598cd 100644
--- a/plugin/server_audit/server_audit.c
+++ b/plugin/server_audit/server_audit.c
@@ -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);