Commit 053143ef authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-7883 Segmentation failure when running mysqladmin -u root -p

take into account that argc can be 0
(if there were no commands on the command line)
parent 18215dd9
......@@ -1198,6 +1198,9 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
static char **mask_password(int argc, char ***argv)
{
char **temp_argv;
if (!argc)
return NULL;
temp_argv= (char **)(my_malloc(sizeof(char *) * argc, MYF(MY_WME)));
argc--;
while (argc > 0)
......
......@@ -45,3 +45,9 @@ EOF
--exec $MYSQLADMIN --defaults-extra-file=$MYSQLTEST_VARDIR/tmp/cnf_file -uroot -S $MASTER_MYSOCK -P $MASTER_MYPORT ping 2>&1
--remove_file $MYSQLTEST_VARDIR/tmp/cnf_file
#
# MDEV-7883 Segmentation failure when running mysqladmin -u root -p
#
--error 1
--exec $MYSQLADMIN -u root -p 2>&1 > /dev/null
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment