From 1e7f06371a05bc7b3d8244536a85408187e9e58d Mon Sep 17 00:00:00 2001 From: Chuck Bell Date: Wed, 7 Sep 2011 14:03:17 -0400 Subject: [PATCH] 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. --- client/mysql_plugin.c | 4 ++-- 1 file 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));