]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix the corner case when there is only "\0\0" appended and the Index is 1. Return...
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 11 Oct 2010 04:37:28 +0000 (04:37 +0000)
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 11 Oct 2010 04:37:28 +0000 (04:37 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10914 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c

index 62ba39484306455382592a3039213a8f2d3e6a2c..be3409457a827a00ee3f7dcee139f6efebaf71c4 100644 (file)
@@ -677,7 +677,11 @@ GetOptionalStringByIndex (
     StrSize           = AsciiStrSize (OptionalStrStart);\r
   } while (OptionalStrStart[StrSize] != 0 && Index != 0);\r
 \r
-  if (Index != 0) {\r
+  if ((Index != 0) || (StrSize == 1)) {\r
+    //\r
+    // Meet the end of strings set but Index is non-zero, or\r
+    // Find an empty string\r
+    //\r
     *String = GetStringById (STRING_TOKEN (STR_MISSING_STRING));\r
   } else {\r
     *String = AllocatePool (StrSize * sizeof (CHAR16));\r