summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-03-25 09:41:09 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2009-03-25 09:41:09 +0000
commit2fef9e5f7a7738ea1b7d4fd2b8a454358698a64b (patch)
tree2fa6fe054324c1d1908085043b81999280f7d764
parentd26b17e3c760f6320fa78393f4a7da7b2f36af29 (diff)
downloadedk2-platforms-2fef9e5f7a7738ea1b7d4fd2b8a454358698a64b.tar.xz
Fix a potential bug that GetLanguages() API may return incorrect languages in a string package when the *LanguageSize == OutputSize.
This issue was hidden since UefiHiiLib API HiiLibGetSupportedLanguages() allocates large enough (4K) buffer to get the supported languages. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7953 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/String.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
index 64148fe131..c6edd87cfd 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/String.c
@@ -1536,7 +1536,7 @@ HiiGetLanguages (
) {
StringPackage = CR (Link, HII_STRING_PACKAGE_INSTANCE, StringEntry, HII_STRING_PACKAGE_SIGNATURE);
ResultSize += AsciiStrSize (StringPackage->StringPkgHdr->Language);
- if (ResultSize < *LanguagesSize) {
+ if (ResultSize <= *LanguagesSize) {
AsciiStrCpy (Languages, StringPackage->StringPkgHdr->Language);
Languages += AsciiStrSize (StringPackage->StringPkgHdr->Language);
*(Languages - 1) = L';';