diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-12-09 10:00:49 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-12-09 10:00:49 +0100 |
commit | abf9d35213ba482a3927651ddb98baa47aeb34fd (patch) | |
tree | 567bee47df18c21d5fbc09bbb4fee4e8f26df4d9 /client/mysql_plugin.c | |
parent | 50a796dcba2abe5f25c1e4cd8a69d7ea43343a8d (diff) | |
parent | 40ae1b9b618fbbc3b494a896a9d074b74e414337 (diff) | |
download | mariadb-git-abf9d35213ba482a3927651ddb98baa47aeb34fd.tar.gz |
Merge branch 'mysql/5.5' into 5.5
Diffstat (limited to 'client/mysql_plugin.c')
-rw-r--r-- | client/mysql_plugin.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index 99da157f8c6..bc9969c9b66 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -407,7 +407,7 @@ exit: static void usage(void) { PRINT_VERSION; - puts("Copyright (c) 2011, Oracle and/or its affiliates. " + puts("Copyright (c) 2011, 2015, Oracle and/or its affiliates. " "All rights reserved.\n"); puts("Enable or disable plugins."); printf("\nUsage: %s [options] <plugin> ENABLE|DISABLE\n\nOptions:\n", @@ -758,6 +758,11 @@ static int check_options(int argc, char **argv, char *operation) /* read the plugin config file and check for match against argument */ else { + if (strlen(argv[i]) + 4 + 1 > FN_REFLEN) + { + fprintf(stderr, "ERROR: argument is too long.\n"); + return 1; + } strcpy(plugin_name, argv[i]); strcpy(config_file, argv[i]); strcat(config_file, ".ini"); @@ -849,6 +854,7 @@ static int process_options(int argc, char *argv[], char *operation) if (opt_basedir[i-1] != FN_LIBCHAR || opt_basedir[i-1] != FN_LIBCHAR2) { char buff[FN_REFLEN]; + memset(buff, 0, sizeof(buff)); strncpy(buff, opt_basedir, sizeof(buff) - 1); #ifdef __WIN__ |