public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC/PATCHv2 1/2] Common/command: Guard strchr/strlen from NULL pointer
Date: Sat, 27 Nov 2010 23:19:43 +0100	[thread overview]
Message-ID: <20101127221943.24CD3B7172@gemini.denx.de> (raw)
In-Reply-To: <1290600472-23147-1-git-send-email-weber@corscience.de>

Dear Thomas Weber,

In message <1290600472-23147-1-git-send-email-weber@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@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

  reply	other threads:[~2010-11-27 22:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-24 10:15 [U-Boot] [RFC/PATCH] common/command.c: Guard strchr/strlen from NULL pointer Thomas Weber
2010-11-24 11:07 ` Wolfgang Denk
2010-11-24 12:07   ` [U-Boot] [RFC/PATCHv2 1/2] Common/command: " Thomas Weber
2010-11-27 22:19     ` Wolfgang Denk [this message]
2010-11-24 12:07   ` [U-Boot] [RFC/PATCHv2 2/2] Common/cmd_nvedit: Check for env subcommand Thomas Weber
2010-11-27 22:19     ` Wolfgang Denk
2010-11-24 12:44 ` [U-Boot] [RFC/PATCH] common/command.c: Guard strchr/strlen from NULL pointer Sergei Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101127221943.24CD3B7172@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox