bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

first post-5.0.1 bug: [ can segfault


From: Jim Meyering
Subject: first post-5.0.1 bug: [ can segfault
Date: Wed, 16 Jul 2003 09:47:43 +0200

FYI,
I just noticed this:

        Running `[' with no arguments would evoke a segfault.
        * src/test.c (main) [LBRACKET]: Move initialization of argv to
        precede potential use via test_syntax_error.

Index: src/test.c
===================================================================
RCS file: /fetish/cu/src/test.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -p -u -r1.87 -r1.88
--- src/test.c  6 Jul 2003 06:12:20 -0000       1.87
+++ src/test.c  16 Jul 2003 06:43:02 -0000      1.88
@@ -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;
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]