public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Zhichao" <zhichao.gao@intel.com>
To: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Gao, Liming" <liming.gao@intel.com>
Subject: Re: [PATCH] ShellPkg/Application/Shell: add array index check for shell delay option
Date: Mon, 18 Feb 2019 08:27:59 +0000	[thread overview]
Message-ID: <3CE959C139B4C44DBEA1810E3AA6F9000B79F5CD@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <20190214025505.4184-1-zhichao.gao@intel.com>

Ignore this patch. The commit massage is not in compliance with https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-Format.

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Zhichao Gao
> Sent: Thursday, February 14, 2019 10:55 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>
> Subject: [edk2] [PATCH] ShellPkg/Application/Shell: add array index check for
> shell delay option
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1528
> Shell delay option without parameters do not check the index of shell
> parameter argv. Add index check to avoid invalid pointer references.
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> ---
>  ShellPkg/Application/Shell/Shell.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Application/Shell/Shell.c
> b/ShellPkg/Application/Shell/Shell.c
> index 104f4c8961..f4d9668d81 100644
> --- a/ShellPkg/Application/Shell/Shell.c
> +++ b/ShellPkg/Application/Shell/Shell.c
> @@ -1002,7 +1002,11 @@ ProcessCommandLine(
>                                   ) == 0) {
>        ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay        = TRUE;
>        // Check for optional delay value following "-delay"
> -      DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1];
> +      if ((LoopVar + 1) >= gEfiShellParametersProtocol->Argc) {
> +        DelayValueStr = NULL;
> +      } else {
> +        DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1];
> +      }
>        if (DelayValueStr != NULL){
>          if (*DelayValueStr == L':') {
>            DelayValueStr++;
> --
> 2.16.2.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


      reply	other threads:[~2019-02-18  8:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14  2:55 [PATCH] ShellPkg/Application/Shell: add array index check for shell delay option Zhichao Gao
2019-02-18  8:27 ` Gao, Zhichao [this message]

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-list 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=3CE959C139B4C44DBEA1810E3AA6F9000B79F5CD@SHSMSX101.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /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