All of lore.kernel.org
 help / color / mirror / Atom feed
From: DENX Support System <support@denx.de>
To: u-boot@lists.denx.de
Subject: [DNX#2006040142000688] [U-Boot-Users] Re: parse bug in cmd_mii.c
Date: Sat, 1 Apr 2006 00:20:30 +0200	[thread overview]
Message-ID: <1143843630.459595.985547467@castor.denx.de> (raw)

Hello list,

inside the automatic U-Boot patch tracking system a new ticket
[DNX#2006040142000688] was created:

<snip>
> Sorry, it looks like I never sent it in.  Here goes:
> 
> CHANGELOG
> * entering 'mii' with no arguments causes a null pointer reference.
> Check argc is >=2 before dereferencing argv[1].  Print the usage message
> if
> not.
> Patch by Andrew Dyer <amdyer@gmail.com>, Sat Mar 11 21:42:12 CST 2006
> 
> Signed-off-by: Andrew Dyer <amdyer@gmail.com>
> 
> Index: cmd_mii.c
> ===================================================================
> RCS file: /home/cvsroot/Projects/u-boot/common/cmd_mii.c,v
> retrieving revision 1.1.1.5
> retrieving revision 1.8
> diff -u -r1.1.1.5 -r1.8
> --- cmd_mii.c   7 Feb 2006 09:51:23 -0000       1.1.1.5
> +++ cmd_mii.c   12 Mar 2006 03:33:56 -0000      1.8
> @@ -61,6 +61,11 @@
>         mii_init ();
>  #endif
> 
> +       if (argc < 2) {
> +               printf ("Usage:\n%s\n", cmdtp->usage);
> +               return 1;
> +       }
> +
>         /*
>          * We use the last specified parameters, unless new ones are
>          * entered.
> @@ -438,6 +443,11 @@
>  #ifdef CONFIG_8xx
>         mii_init ();
>  #endif
> +
> +       if (argc < 2) {
> +               printf ("Usage:\n%s\n", cmdtp->usage);
> +               return 1;
> +       }
> 
>         /*
>          * We use the last specified parameters, unless new ones are
> 
> 
> 
> 
> On 3/11/06, Wolfgang Denk <wd@denx.de> wrote:
> > In message <c166aa9f0506131006ba8f552@mail.gmail.com> you wrote:
> > > I noticed that in do_mii() the code is dereferencing argv[1] without
> > > checking what value argc has.  This leads to an exception if a command
> > > line like 'mii ' is given where argv[1] is NULL.
> > >
> > > I have a patch, but my cmd_mii.c is carrying around some other patches
> > > (some submitted to the list, some local).  Is there a good way to
> > > separate out the patches I want to submit by themselves?
> >
> > Did I miss it, or did you never send a  patch  for  the  problem  you
> > mentioned?
> >
> >
> > Best regards,
> >
> > Wolfgang Denk
> >
> > --
> > Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
> > Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> > "'Tis true, 'tis pity, and pity 'tis 'tis true."
> >     - Poloniouius, in Willie the Shake's _Hamlet, Prince of Darkness_
> >
> 
> 
> --
> Hardware, n.:
>         The parts of a computer system that can be kicked.
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> that extends applications into web and mobile media. Attend the live
> webcast
> and join the prime developer group breaking into this new coding
> territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid\x110944&bid$1720&dat\x121642
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
</snip>

Your U-Boot support team

                 reply	other threads:[~2006-03-31 22:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1143843630.459595.985547467@castor.denx.de \
    --to=support@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.