1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

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.
This commit is contained in:
Chuck Bell
2011-09-07 14:03:17 -04:00
parent 0750d88c15
commit 1e7f06371a

View File

@@ -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));