summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c')
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c
index b153d2fe45..69193d5efa 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c
@@ -163,8 +163,8 @@ ShellLevel2CommandsLibDestructor (
@param[in] Path The unknown Path Value
@retval NULL A memory allocation failed
- @retval NULL a fully qualified path could not be discovered.
- @retval other pointer to a fuly qualified path.
+ @retval NULL A fully qualified path could not be discovered.
+ @retval other An allocated pointer to a fuly qualified path.
**/
CHAR16*
EFIAPI
@@ -194,6 +194,10 @@ GetFullyQualifiedPath(
PathCleanUpDirectories(PathToReturn);
+ if (PathTpReturn == NULL) {
+ return NULL;
+ }
+
while (PathToReturn[StrLen(PathToReturn)-1] == L'*') {
PathToReturn[StrLen(PathToReturn)-1] = CHAR_NULL;
}