public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ruiyu" <ruiyu.ni@intel.com>
To: "Bi, Dandan" <dandan.bi@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Carsey, Jaben" <jaben.carsey@intel.com>
Subject: Re: [patch] ShellPkg: Add the check of parameter number in "DrvCfg" command
Date: Thu, 1 Sep 2016 01:34:46 +0000	[thread overview]
Message-ID: <734D49CCEBEEF84792F5B80ED585239D58D4598D@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1472621209-205768-2-git-send-email-dandan.bi@intel.com>



Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
> -----Original Message-----
> From: Bi, Dandan
> Sent: Wednesday, August 31, 2016 1:27 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu <ruiyu.ni@intel.com>; Carsey, Jaben <jaben.carsey@intel.com>
> Subject: [patch] ShellPkg: Add the check of parameter number in "DrvCfg"
> command
> 
> In shell spec, the usage of "Drvcfg" command is: drvcfg [-l XXX] [-c] [-f
> <Type>|-v|-s] [DriverHandle [DeviceHandle [ChildHandle]]] [-i filename] [-o
> filename]. The parameter number(doesn't include the flags) cannot exceed 4,
> now we add this point to check whether using the command correctly.
> 
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jaben Carsey <jaben.carsey@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
> b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
> index 0d12f01..cc1c9ca 100644
> --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
> +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvCfg.c
> @@ -1210,10 +1210,15 @@ ShellCommandRunDrvCfg (
>          ASSERT(FALSE);
>        }
>      }
>    }
>    if (ShellStatus == SHELL_SUCCESS) {
> +    if (ShellCommandLineGetCount(Package) > 4) {
> +      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY),
> gShellDriver1HiiHandle, L"drvcfg");
> +      ShellStatus = SHELL_INVALID_PARAMETER;
> +      goto Done;
> +    }
>      Lang = ShellCommandLineGetValue(Package, L"-l");
>      if (Lang != NULL) {
>        Language = AllocateZeroPool(StrSize(Lang));
>        AsciiSPrint(Language, StrSize(Lang), "%S", Lang);
>      } else if (ShellCommandLineGetFlag(Package, L"-l")){
> --
> 1.9.5.msysgit.1



  parent reply	other threads:[~2016-09-01  1:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-31  5:26 [patch] ShellPkg: Add check for "dump" parameter in "bcfg" command Dandan Bi
2016-08-31  5:26 ` [patch] ShellPkg: Add the check of parameter number in "DrvCfg" command Dandan Bi
2016-08-31 14:23   ` Shah, Tapan
2016-08-31 16:10     ` Carsey, Jaben
2016-09-01  1:34   ` Ni, Ruiyu [this message]
2016-08-31 14:23 ` [patch] ShellPkg: Add check for "dump" parameter in "bcfg" command Shah, Tapan
2016-08-31 16:11 ` Carsey, Jaben
2016-09-01  1:08   ` Bi, Dandan
2016-09-01  1:44     ` Carsey, Jaben
2016-09-01  1:58 ` Ni, Ruiyu

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=734D49CCEBEEF84792F5B80ED585239D58D4598D@SHSMSX103.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