From: Jim Meyering Date: Wed, 16 Jul 2003 06:43:02 +0000 (+0000) Subject: Running `[' with no arguments would evoke a segfault. X-Git-Tag: v5.0.90~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0049fa1eda0434a8ef0bf323217b7fe98a037531;p=thirdparty%2Fcoreutils.git Running `[' with no arguments would evoke a segfault. (main) [LBRACKET]: Move initialization of argv to precede potential use via test_syntax_error. --- diff --git a/src/test.c b/src/test.c index 1fec21f8d6..3db4f93fd7 100644 --- a/src/test.c +++ b/src/test.c @@ -1091,6 +1091,8 @@ main (int margc, char **margv) parse_long_options (margc, margv, PROGRAM_NAME, GNU_PACKAGE, VERSION, AUTHORS, usage); + argv = margv; + if (LBRACKET) { --margc; @@ -1099,7 +1101,6 @@ main (int margc, char **margv) test_syntax_error (_("missing `]'\n"), NULL); } - argv = margv; argc = margc; pos = 1;