diff options
author | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-10-11 04:37:28 +0000 |
---|---|---|
committer | niruiyu <niruiyu@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-10-11 04:37:28 +0000 |
commit | d69bf66dc1ad8143260dcb8e095d7ed91b211dd7 (patch) | |
tree | 895209504266948e3fcb8c6036272f4a3541ebaf /IntelFrameworkModulePkg | |
parent | f515069c194f418b74915be4a2e021c2b3ae2c46 (diff) | |
download | edk2-platforms-d69bf66dc1ad8143260dcb8e095d7ed91b211dd7.tar.xz |
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')
-rw-r--r-- | IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c | 6 |
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));
|