mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
Running `[' with no arguments would evoke a segfault.
(main) [LBRACKET]: Move initialization of argv to precede potential use via test_syntax_error.
This commit is contained in:
1 parent
02ba301550
commit
0049fa1eda
1 file changed
+2
-1
+2
-1
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user