]> git.proxmox.com Git - mirror_edk2.git/commitdiff
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9758 6f19259b...
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 14 Jan 2010 20:26:39 +0000 (20:26 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 14 Jan 2010 20:26:39 +0000 (20:26 +0000)
ShellPkg/Library/UefiShellLib/UefiShellLib.c

index 369bb81a58ed3bd8d1625578bfdc06aae4659b87..db46b80f9aa2868a5143509b548ea115b2e9e74e 100644 (file)
@@ -1564,6 +1564,7 @@ ShellFindFilePathEx (
   CHAR16            *TestPath;\r
   CHAR16            *RetVal;\r
   CONST CHAR16      *ExtensionWalker;\r
+  UINTN             Size;\r
   ASSERT(FileName != NULL);\r
   if (FileExtension == NULL) {\r
     return (ShellFindFilePath(FileName));\r
@@ -1572,7 +1573,9 @@ ShellFindFilePathEx (
   if (RetVal != NULL) {\r
     return (RetVal);\r
   }\r
-  TestPath = AllocateZeroPool(StrSize(FileName) + StrSize(FileExtension));\r
+  Size =  StrSize(FileName);\r
+  Size += StrSize(FileExtension);\r
+  TestPath = AllocateZeroPool(Size);\r
   for (ExtensionWalker = FileExtension ;  ; ExtensionWalker = StrStr(ExtensionWalker, L";") + 1 ){\r
     StrCpy(TestPath, FileName);\r
     StrCat(TestPath, ExtensionWalker);\r