Reviewed-by: Jaben Carsey <[email protected]>

> -----Original Message-----
> From: edk2-devel [mailto:[email protected]] On Behalf Of
> Ruiyu Ni
> Sent: Wednesday, November 07, 2018 1:37 AM
> To: [email protected]
> Cc: Wu, Hao A <[email protected]>; Jim Dailey <[email protected]>
> Subject: [edk2] [PATCH] ShellPkg/ShellLib: Fix potential NULL deference
> issue
> Importance: High
> 
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Ruiyu Ni <[email protected]>
> Cc: Jim Dailey <[email protected]>
> Cc: Hao A Wu <[email protected]>
> ---
>  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
> [email protected]
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to