mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 07:05:33 +02:00
Bug#29361 mysqldump creates stray file when too long path name is passed
- Move the check of too long path to 'get_one_option' client/mysqldump.c: Move the check of too long path to 'get_one_option' mysql-test/r/mysqldump.result: Update result file after changing error message
This commit is contained in:
parent
6437c0356a
commit
dec626f492
2 changed files with 13 additions and 12 deletions
|
|
@ -686,6 +686,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
break;
|
||||
case 'T':
|
||||
opt_disable_keys=0;
|
||||
|
||||
if (strlen(argument) >= FN_REFLEN)
|
||||
{
|
||||
/*
|
||||
This check is made because the some the file functions below
|
||||
have FN_REFLEN sized stack allocated buffers and will cause
|
||||
a crash even if the input destination buffer is large enough
|
||||
to hold the output.
|
||||
*/
|
||||
die(EX_USAGE, "Input filename too long: %s", argument);
|
||||
}
|
||||
|
||||
break;
|
||||
case '#':
|
||||
DBUG_PUSH(argument ? argument : default_dbug_option);
|
||||
|
|
@ -2324,17 +2336,6 @@ static void dump_table(char *table, char *db)
|
|||
{
|
||||
char filename[FN_REFLEN], tmp_path[FN_REFLEN];
|
||||
|
||||
if (strlen(path) >= FN_REFLEN)
|
||||
{
|
||||
/*
|
||||
This check is made because the some the file functions below
|
||||
have FN_REFLEN sized stack allocated buffers and will cause
|
||||
a crash even if the input destination buffer is large enough
|
||||
to hold the output.
|
||||
*/
|
||||
die(EX_USAGE, "Input filename or options too long: %s", path);
|
||||
}
|
||||
|
||||
/*
|
||||
Convert the path to native os format
|
||||
and resolve to the full filepath.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue