Skip to content

Commit add5137

Browse files
author
Alexey Botchkov
committed
MDEV-28429 audit plugin report OOOOO.
Few initializations to the connection_info structure added. I think they can be removed if we are sure the bug was fixed.
1 parent 0806592 commit add5137

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

plugin/server_audit/server_audit.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
#define PLUGIN_VERSION 0x104
18-
#define PLUGIN_STR_VERSION "1.4.13"
18+
#define PLUGIN_STR_VERSION "1.4.14"
1919

2020
#define _my_thread_var loc_thread_var
2121

@@ -945,7 +945,19 @@ static unsigned long long query_counter= 1;
945945

946946
static struct connection_info *get_loc_info(MYSQL_THD thd)
947947
{
948+
/*
949+
This is the original code and supposed to be returned
950+
bach to this as the MENT-1438 is finally understood/resolved.
948951
return (struct connection_info *) THDVAR(thd, loc_info);
952+
*/
953+
struct connection_info *ci= (struct connection_info *) THDVAR(thd, loc_info);
954+
if ((size_t) ci->user_length > sizeof(ci->user))
955+
{
956+
ci->user_length= 0;
957+
ci->host_length= 0;
958+
ci->ip_length= 0;
959+
}
960+
return ci;
949961
}
950962

951963

@@ -1373,6 +1385,16 @@ static size_t log_header(char *message, size_t message_len,
13731385
host= userip;
13741386
}
13751387

1388+
/*
1389+
That was added to find the possible cause of the MENT-1438.
1390+
Supposed to be removed after that.
1391+
*/
1392+
if (username_len > 1024)
1393+
{
1394+
username= "unknown_user";
1395+
username_len= (unsigned int) strlen(username);
1396+
}
1397+
13761398
if (output_type == OUTPUT_SYSLOG)
13771399
return my_snprintf(message, message_len,
13781400
"%.*s,%.*s,%.*s,%d,%lld,%s",

0 commit comments

Comments
 (0)