summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 5b4c6d3fb7..3521515468 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -3254,7 +3254,8 @@ StrnCatGrow (
*CurrentSize = NewSize;
}
} else {
- *Destination = AllocateZeroPool((Count+1)*sizeof(CHAR16));
+ NewSize = (Count+1)*sizeof(CHAR16);
+ *Destination = AllocateZeroPool(NewSize);
}
//
@@ -3264,7 +3265,7 @@ StrnCatGrow (
return (NULL);
}
- StrCatS(*Destination, Count + 1, Source);
+ StrnCatS(*Destination, NewSize/sizeof(CHAR16), Source, Count);
return *Destination;
}