diff options
author | Chuck Bell <chuck.bell@oracle.com> | 2011-09-07 14:03:17 -0400 |
---|---|---|
committer | Chuck Bell <chuck.bell@oracle.com> | 2011-09-07 14:03:17 -0400 |
commit | d1d47bb8a7acf6a7537af52d4047a7f257633b34 (patch) | |
tree | e8042a9112a7028672cee851676ed0a58657f8e3 /client/mysql_plugin.c | |
parent | 5acc7cacae5be0153487092dc47869a07f70da14 (diff) | |
download | mariadb-git-d1d47bb8a7acf6a7537af52d4047a7f257633b34.tar.gz |
BUG#12929345 : Execution aborts without any messages (Windows only)
This patch adds the length of the buffer in the strncat operation
to prevent buffer overrun.
Diffstat (limited to 'client/mysql_plugin.c')
-rw-r--r-- | client/mysql_plugin.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/mysql_plugin.c b/client/mysql_plugin.c index ec3dc64f0d8..406366efd51 100644 --- a/client/mysql_plugin.c +++ b/client/mysql_plugin.c @@ -851,9 +851,9 @@ static int process_options(int argc, char *argv[], char *operation) strncpy(buff, opt_basedir, sizeof(buff) - 1); #ifdef __WIN__ - strncat(buff, "/", sizeof(buff) - 1); + strncat(buff, "/", sizeof(buff) - strlen(buff) - 1); #else - strncat(buff, FN_DIRSEP, sizeof(buff) - 1); + strncat(buff, FN_DIRSEP, sizeof(buff) - strlen(buff) - 1); #endif buff[sizeof(buff) - 1]= 0; my_delete(opt_basedir, MYF(0)); |