mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
f515069c19
commit
d69bf66dc1
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue