summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellLevel3CommandsLib
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel3CommandsLib')
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c
index 7eb3c8c0e8..29f6be3931 100644
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c
+++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Touch.c
@@ -79,11 +79,16 @@ DoTouchByHandle (
if (FS == NULL) {
FS = StrnCatGrow(&FS, NULL, Name, 0);
- TempSpot = StrStr(FS, L"\\");
- if (TempSpot != NULL) {
- *TempSpot = CHAR_NULL;
+ if (FS != NULL) {
+ TempSpot = StrStr(FS, L"\\");
+ if (TempSpot != NULL) {
+ *TempSpot = CHAR_NULL;
+ }
}
}
+ if (FS == NULL) {
+ return (EFI_INVALID_PARAMETER);
+ }
//
// do it