[PATCH] echo not working for ENABLE_FEATURE_FANCY_ECHO=n

Harald Küthe harald-tuxbox at arcor.de
Fri Jun 8 12:12:02 UTC 2007


Hello list,

there is one more:
echo without parameter results in a illegal pointer access.

Patch against 1.6.0:
--- busybox-1.6.0.orig/coreutils/echo.c 2007-06-01 13:48:34.000000000 +0200
+++ busybox-1.6.0/coreutils/echo.c 2007-06-05 23:07:14.000000000 +0200
@@ -33,7 +33,9 @@
   eflag = '\\',
   nflag = 1,  /* 1 -- print '\n' */
  };
- ++argv;
+ arg = *++argv;
+ if (!arg)
+  goto ret;
 #else
  const char *p;
  char nflag = 1;


----- Original Message ----- 
From: "Harald Küthe" <harald-tuxbox at arcor.de>
To: <busybox at busybox.net>
Sent: Tuesday, June 05, 2007 11:25 PM
Subject: [PATCH] echo not working for ENABLE_FEATURE_FANCY_ECHO=n


> Hello list,
>
> echo is not working for ENABLE_FEATURE_FANCY_ECHO=n
> due to arg not being initialised.
>
> This trivial patch fixes this:
> --- busybox-1.6.0.orig/coreutils/echo.c 2007-06-01 13:48:34.000000000 
> +0200
> +++ busybox-1.6.0/coreutils/echo.c 2007-06-05 23:07:14.000000000 +0200
> @@ -33,7 +33,7 @@
>   eflag = '\\',
>   nflag = 1,  /* 1 -- print '\n' */
>  };
> - ++argv;
> + arg = *++argv;
> #else
>  const char *p;
>  char nflag = 1;
>
> regards
> Harald
> 





More information about the busybox mailing list