Skip to content
/ server Public

Commit 76fc186

Browse files
gkodinovvuvova
authored andcommitted
MDEV-38642: Missing Null terminator in the definition of mysqldump's --system typelib
There was a missing NULL element terminator for --system's type library definition. This was causing a crash in find_type_eol when e.g. an incomplete value was passed to --system where it keeps iterating until it finds the NULL as a typelib element. Fixed by appending a NullS to the definition. Test case added.
1 parent cb31d75 commit 76fc186

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

client/mysqldump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0, opt_no_data_m
138138
#define OPT_SYSTEM_STATS 32
139139
#define OPT_SYSTEM_TIMEZONES 64
140140
static const char *opt_system_type_values[]=
141-
{"all", "users", "plugins", "udfs", "servers", "stats", "timezones"};
141+
{"all", "users", "plugins", "udfs", "servers", "stats", "timezones", NullS};
142142
static TYPELIB opt_system_types=
143143
{
144-
array_elements(opt_system_type_values), "system dump options",
144+
array_elements(opt_system_type_values) - 1, "system dump options",
145145
opt_system_type_values, NULL
146146
};
147147
static ulonglong opt_system= 0ULL;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# MDEV-38642 Missing Null terminator in the definition of mysqldump's
3+
# --system typelib
4+
#
5+
# Should not crash
6+
# End of 10.6 tests
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--source include/not_embedded.inc
2+
3+
--echo #
4+
--echo # MDEV-38642 Missing Null terminator in the definition of mysqldump's
5+
--echo # --system typelib
6+
--echo #
7+
8+
--echo # Should not crash
9+
--exec $MYSQL_DUMP --system=user > /dev/null
10+
11+
--echo # End of 10.6 tests

0 commit comments

Comments
 (0)