summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c')
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
index ed9940d827..0b23fba150 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
@@ -231,7 +231,9 @@ IsValidDeleteTarget(
Pattern = NULL;
SearchString = NULL;
Size = 0;
- Pattern = StrnCatGrow(&Pattern , NULL, TempLocation , 0);
+ Pattern = StrnCatGrow(&Pattern, &Size, TempLocation , 0);
+ Pattern = StrnCatGrow(&Pattern, &Size, L"\\" , 0);
+ Size = 0;
SearchString = StrnCatGrow(&SearchString, &Size, Node->FullName, 0);
if (!EFI_ERROR(ShellIsDirectory(SearchString))) {
SearchString = StrnCatGrow(&SearchString, &Size, L"\\", 0);