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:
@@ -851,9 +851,9 @@ static int process_options(int argc, char *argv[], char *operation)
|
|||||||
|
|
||||||
strncpy(buff, opt_basedir, sizeof(buff) - 1);
|
strncpy(buff, opt_basedir, sizeof(buff) - 1);
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
strncat(buff, "/", sizeof(buff) - 1);
|
strncat(buff, "/", sizeof(buff) - strlen(buff) - 1);
|
||||||
#else
|
#else
|
||||||
strncat(buff, FN_DIRSEP, sizeof(buff) - 1);
|
strncat(buff, FN_DIRSEP, sizeof(buff) - strlen(buff) - 1);
|
||||||
#endif
|
#endif
|
||||||
buff[sizeof(buff) - 1]= 0;
|
buff[sizeof(buff) - 1]= 0;
|
||||||
my_delete(opt_basedir, MYF(0));
|
my_delete(opt_basedir, MYF(0));
|
||||||
|
Reference in New Issue
Block a user