diff options
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c')
-rw-r--r-- | ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c index 88791c4428..7052dc33a1 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cd.c @@ -304,7 +304,12 @@ ShellCommandRunCd ( if (!EFI_ERROR (Status)) {
Param1Copy = PathCleanUpDirectories (Param1Copy);
- Status = ExtractDriveAndPath (Param1Copy, &Drive, &Path);
+ if (Param1Copy == NULL) {
+ Status = EFI_NOT_FOUND;
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ } else {
+ Status = ExtractDriveAndPath (Param1Copy, &Drive, &Path);
+ }
}
if (!EFI_ERROR (Status) && (Drive != NULL) && (Path != NULL)) {
|