diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-06-26 20:06:12 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-07-05 17:15:58 +0200 |
commit | 2bf017c210d00e3cea281aee9f241a01a3f85b7f (patch) | |
tree | 48da932e4db5f284ff24743f1a7f73594676af56 /plugin | |
parent | 47687eef41b97edac423b4ff694cdd20cf804901 (diff) | |
download | mariadb-git-2bf017c210d00e3cea281aee9f241a01a3f85b7f.tar.gz |
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
* uninitialized user field when thd in NULL
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/server_audit/server_audit.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c index ee00c9e1385..65de695ac9e 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); |