[U-Boot] [RFC/PATCHv2 1/2] Common/command: Guard strchr/strlen from NULL pointer

Wolfgang Denk wd at denx.de
Sat Nov 27 23:19:43 CET 2010


Dear Thomas Weber,

In message <1290600472-23147-1-git-send-email-weber at corscience.de> you wrote:
> Guard strchr/strlen from being called with NULL pointer.
> This line is crashing when command "env" is called without subcommand.
> 
> The cmd is NULL in this case because the calling function "do_env"
> decremented the argc without checking if there are still arguments available.
> 
> Signed-off-by: Thomas Weber <weber at corscience.de>
> ---
> Changes for v2: 
> 	- Use shorter way to leave function in error case.
> 
>  common/command.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Every little picofarad has a nanohenry all its own.      - Don Vonada


More information about the U-Boot mailing list