public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Carsey, Jaben" <jaben.carsey@intel.com>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>, Jim Dailey <jim_dailey@dell.com>
Subject: Re: [PATCH] ShellPkg/ShellLib: Fix potential NULL deference issue
Date: Wed, 7 Nov 2018 18:54:02 +0000	[thread overview]
Message-ID: <CB6E33457884FA40993F35157061515CA713C569@fmsmsx101.amr.corp.intel.com> (raw)
In-Reply-To: <20181107093637.168244-1-ruiyu.ni@intel.com>

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Wednesday, November 07, 2018 1:37 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Jim Dailey <jim_dailey@dell.com>
> Subject: [edk2] [PATCH] ShellPkg/ShellLib: Fix potential NULL deference
> issue
> Importance: High
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jim Dailey <jim_dailey@dell.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> ---
>  ShellPkg/Library/UefiShellLib/UefiShellLib.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> index 580a1ee612..b17266d623 100644
> --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> @@ -72,6 +72,7 @@ FullyQualifyPath(
>  {
>    CONST CHAR16         *WorkingPath;
>    CONST CHAR16         *InputPath;
> +  CHAR16               *CharPtr;
>    CHAR16               *InputFileSystem;
>    UINTN                FileSystemCharCount;
>    CHAR16               *FullyQualifiedPath;
> @@ -131,7 +132,10 @@ FullyQualifyPath(
>          // truncate the new path after the file system part.
>          //
>          StrCpyS(FullyQualifiedPath, Size/sizeof(CHAR16), WorkingPath);
> -        *(StrStr(FullyQualifiedPath, L":") + 1) = CHAR_NULL;
> +        CharPtr = StrStr(FullyQualifiedPath, L":");
> +        if (CharPtr != NULL) {
> +          *(CharPtr + 1) = CHAR_NULL;
> +        }
>        } else {
>          //
>          // Relative path: start with the working directory and append "\".
> --
> 2.16.1.windows.1
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel


  parent reply	other threads:[~2018-11-07 18:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-07  9:36 [PATCH] ShellPkg/ShellLib: Fix potential NULL deference issue Ruiyu Ni
2018-11-07 17:09 ` Philippe Mathieu-Daudé
2018-11-07 18:54 ` Carsey, Jaben [this message]
2018-11-08  0:46 ` Wu, Hao A

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=CB6E33457884FA40993F35157061515CA713C569@fmsmsx101.amr.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