summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2019-07-26 08:44:43 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2019-07-26 08:44:43 +0400
commit51d58f566af0dea01bc391798e05c7edf53b345f (patch)
tree098e12c16a8125abc9d9253d6bf2e6928ec933fb /plugin
parentf6d0d309fa4ffe1d5890c09447d947103143a68a (diff)
downloadmariadb-git-51d58f566af0dea01bc391798e05c7edf53b345f.tar.gz
MDEV-18350 Using audit plugin with MySQL, mysqld crashes when running COM_INIT_DB against invalid database.
mysql_event_general structure changed in 10.3. the database_length should be size_t now instead of the int.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/server_audit/server_audit.c6
-rw-r--r--plugin/server_audit/test_audit_v4.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c
index 080fdbe3e05..12c610c8187 100644
--- a/plugin/server_audit/server_audit.c
+++ b/plugin/server_audit/server_audit.c
@@ -15,7 +15,7 @@
#define PLUGIN_VERSION 0x104
-#define PLUGIN_STR_VERSION "1.4.7"
+#define PLUGIN_STR_VERSION "1.4.8"
#define _my_thread_var loc_thread_var
@@ -2260,7 +2260,7 @@ static void auditing_v13(MYSQL_THD thd, unsigned int *ev_v0)
}
-int get_db_mysql57(MYSQL_THD thd, char **name, int *len)
+int get_db_mysql57(MYSQL_THD thd, char **name, size_t *len)
{
int db_off;
int db_len_off;
@@ -2287,7 +2287,7 @@ int get_db_mysql57(MYSQL_THD thd, char **name, int *len)
#ifdef __linux__
*name= *(char **) (((char *) thd) + db_off);
- *len= *((int *) (((char*) thd) + db_len_off));
+ *len= *((size_t *) (((char*) thd) + db_len_off));
if (*name && (*name)[*len] != 0)
return 1;
return 0;
diff --git a/plugin/server_audit/test_audit_v4.c b/plugin/server_audit/test_audit_v4.c
index 8cb24bc693b..f37d8c7c34a 100644
--- a/plugin/server_audit/test_audit_v4.c
+++ b/plugin/server_audit/test_audit_v4.c
@@ -16,7 +16,7 @@ enum enum_server_command{ SERVCOM_A, SERVCOM_B };
#include "plugin_audit_v4.h"
extern void auditing(MYSQL_THD thd, unsigned int event_class, const void *ev);
-extern int get_db_mysql57(MYSQL_THD thd, char **name, int *len);
+extern int get_db_mysql57(MYSQL_THD thd, char **name, size_t *len);
struct mysql_event_general_302
@@ -35,7 +35,7 @@ struct mysql_event_general_302
unsigned long long general_rows;
unsigned long long query_id;
char *database;
- int database_length;
+ size_t database_length;
};