mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Fix undersized array in my_print_defaults that caused crash on Sun Solaris
(and maybe strange results on other platforms). (Bug #9851) extra/my_print_defaults.c: Increase size of tmp_arguments array to actually fit possible values
This commit is contained in:
parent
61b1f2ce95
commit
0eb3528741
1 changed files with 12 additions and 1 deletions
|
@ -27,12 +27,20 @@
|
|||
|
||||
const char *config_file="my"; /* Default config file */
|
||||
uint verbose= 0, opt_defaults_file_used= 0;
|
||||
const char *default_dbug_option="d:t:o,/tmp/my_print_defaults.trace";
|
||||
|
||||
static struct my_option my_long_options[] =
|
||||
{
|
||||
{"config-file", 'c', "The config file to be used.",
|
||||
(gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
#ifdef DBUG_OFF
|
||||
{"debug", '#', "This is a non-debug version. Catch this and exit",
|
||||
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#else
|
||||
{"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
|
||||
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#endif
|
||||
{"defaults-file", 'c', "Synonym for --config-file.",
|
||||
(gptr*) &config_file, (gptr*) &config_file, 0, GET_STR, REQUIRED_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
|
@ -95,6 +103,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
case 'V':
|
||||
usage(1);
|
||||
exit(0);
|
||||
case '#':
|
||||
DBUG_PUSH(argument ? argument : default_dbug_option);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -118,7 +129,7 @@ static int get_options(int *argc,char ***argv)
|
|||
int main(int argc, char **argv)
|
||||
{
|
||||
int count, error;
|
||||
char **load_default_groups, *tmp_arguments[2],
|
||||
char **load_default_groups, *tmp_arguments[3],
|
||||
**argument, **arguments;
|
||||
char *defaults, *extra_defaults;
|
||||
MY_INIT(argv[0]);
|
||||
|
|
Loading…
Add table
Reference in a new issue