summaryrefslogtreecommitdiff
path: root/ShellPkg/Library
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-14 20:26:39 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-14 20:26:39 +0000
commit9e926b693de28a1b77f64adda952463dcc481d12 (patch)
treed5e4dc6f145d449151811bfd0aef09b813d56460 /ShellPkg/Library
parentbc230a23ed53574bb6b2da061e24b7a59448f4c5 (diff)
downloadedk2-platforms-9e926b693de28a1b77f64adda952463dcc481d12.tar.xz
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9758 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 369bb81a58..db46b80f9a 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -1564,6 +1564,7 @@ ShellFindFilePathEx (
CHAR16 *TestPath;
CHAR16 *RetVal;
CONST CHAR16 *ExtensionWalker;
+ UINTN Size;
ASSERT(FileName != NULL);
if (FileExtension == NULL) {
return (ShellFindFilePath(FileName));
@@ -1572,7 +1573,9 @@ ShellFindFilePathEx (
if (RetVal != NULL) {
return (RetVal);
}
- TestPath = AllocateZeroPool(StrSize(FileName) + StrSize(FileExtension));
+ Size = StrSize(FileName);
+ Size += StrSize(FileExtension);
+ TestPath = AllocateZeroPool(Size);
for (ExtensionWalker = FileExtension ; ; ExtensionWalker = StrStr(ExtensionWalker, L";") + 1 ){
StrCpy(TestPath, FileName);
StrCat(TestPath, ExtensionWalker);