segfault with 'ash -c type'

Denis Vlasenko vda.linux at googlemail.com
Mon Jun 25 19:33:20 UTC 2007


On Monday 25 June 2007 12:44, Bernhard Fischer wrote:
> 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;
>         }

Applied, thanks!
--
vda



More information about the busybox mailing list