summaryrefslogtreecommitdiffstats
path: root/IntelFrameworkModulePkg/Universal/BdsDxe
diff options
context:
space:
mode:
authorniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2010-10-11 04:37:28 +0000
committerniruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524>2010-10-11 04:37:28 +0000
commitd69bf66dc1ad8143260dcb8e095d7ed91b211dd7 (patch)
tree895209504266948e3fcb8c6036272f4a3541ebaf /IntelFrameworkModulePkg/Universal/BdsDxe
parentf515069c194f418b74915be4a2e021c2b3ae2c46 (diff)
downloadedk2-d69bf66dc1ad8143260dcb8e095d7ed91b211dd7.tar.gz
edk2-d69bf66dc1ad8143260dcb8e095d7ed91b211dd7.tar.bz2
edk2-d69bf66dc1ad8143260dcb8e095d7ed91b211dd7.zip
Fix the corner case when there is only "\0\0" appended and the Index is 1. Return missing string instead of empty string.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10914 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal/BdsDxe')
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
index 62ba394843..be3409457a 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
@@ -677,7 +677,11 @@ GetOptionalStringByIndex (
StrSize = AsciiStrSize (OptionalStrStart);
} while (OptionalStrStart[StrSize] != 0 && Index != 0);
- if (Index != 0) {
+ if ((Index != 0) || (StrSize == 1)) {
+ //
+ // Meet the end of strings set but Index is non-zero, or
+ // Find an empty string
+ //
*String = GetStringById (STRING_TOKEN (STR_MISSING_STRING));
} else {
*String = AllocatePool (StrSize * sizeof (CHAR16));