From: "Wu, Hao A" <hao.a.wu@intel.com>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: Jim Dailey <jim_dailey@dell.com>
Subject: Re: [PATCH] ShellPkg/ShellLib: Fix potential NULL deference issue
Date: Thu, 8 Nov 2018 00:46:21 +0000 [thread overview]
Message-ID: <B80AF82E9BFB8E4FBD8C89DA810C6A093C84B1FE@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20181107093637.168244-1-ruiyu.ni@intel.com>
> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Wednesday, November 07, 2018 5:37 PM
> To: edk2-devel@lists.01.org
> Cc: Jim Dailey; Wu, Hao A
> Subject: [PATCH] ShellPkg/ShellLib: Fix potential NULL deference issue
>
> 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 "\".
> --
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Best Regards,
Hao Wu
> 2.16.1.windows.1
prev parent reply other threads:[~2018-11-08 0:46 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
2018-11-08 0:46 ` Wu, Hao A [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=B80AF82E9BFB8E4FBD8C89DA810C6A093C84B1FE@SHSMSX104.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