diff options
author | Guilhem Bichot <guilhem.bichot@oracle.com> | 2011-02-11 15:00:09 +0100 |
---|---|---|
committer | Guilhem Bichot <guilhem.bichot@oracle.com> | 2011-02-11 15:00:09 +0100 |
commit | 77c0f33ee2b2ad46088364630275735f9d744ed2 (patch) | |
tree | d9d6129bd645413a78561d42f1fdc9c9b94cb638 /client/mysqladmin.cc | |
parent | e9fc441a525de89be0295ef1766c72a7e39c9b1d (diff) | |
download | mariadb-git-77c0f33ee2b2ad46088364630275735f9d744ed2.tar.gz |
Fix for BUG#59894
"set optimizer_switch to e or d causes invalid memory writes/valgrind warnings":
due to prefix support, the argument "e" was overwritten with its full value
"engine_condition_pushdown", which caused a buffer overrun.
This was wrong usage of find_type(); other wrong usages are fixed here too.
Please start reading with the comment of typelib.c.
Diffstat (limited to 'client/mysqladmin.cc')
-rw-r--r-- | client/mysqladmin.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 580caa38c0d..82cea8e78c9 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -369,7 +369,8 @@ int main(int argc,char *argv[]) /* Return 0 if all commands are PING */ for (; argc > 0; argv++, argc--) { - if (find_type(argv[0], &command_typelib, 2) != ADMIN_PING) + if (find_type(argv[0], &command_typelib, FIND_TYPE_BASIC) != + ADMIN_PING) { error= 1; break; @@ -592,7 +593,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) for (; argc > 0 ; argv++,argc--) { - switch (find_type(argv[0],&command_typelib,2)) { + switch (find_type(argv[0],&command_typelib, FIND_TYPE_BASIC)) { case ADMIN_CREATE: { char buff[FN_REFLEN+20]; @@ -931,7 +932,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (typed_password[0]) { - bool old= (find_type(argv[0], &command_typelib, 2) == + bool old= (find_type(argv[0], &command_typelib, FIND_TYPE_BASIC) == ADMIN_OLD_PASSWORD); #ifdef __WIN__ size_t pw_len= strlen(typed_password); |