segfault with 'ash -c type'

Bernhard Fischer rep.dot.nop at gmail.com
Mon Jun 25 10:44:57 UTC 2007


Hi,

consider:
$ ./busybox ash -c type
Segmentation fault

How about
Index: shell/ash.c
===================================================================
--- shell/ash.c (revision 18919)
+++ shell/ash.c (working copy)
@@ -6986,7 +6986,7 @@
        int verbose = 1;
 
        /* type -p ... ? (we don't bother checking for 'p') */
-       if (argv[1][0] == '-') {
+       if (argv[1] && argv[1][0] == '-') {
                i++;
                verbose = 0;
        }




More information about the busybox mailing list