]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/Strings.c
1) Add a stringent check to make sure the package list for UpdateForm call must have...
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / FrameworkHiiToUefiHiiThunk / Strings.c
index 9e2df6fc62cbbb0020f5226480f02fbf4e29455c..14e27dda1891e50fb6f1cae0a43650ad25ae22e9 100644 (file)
@@ -129,6 +129,7 @@ Returns:
   EFI_STRING_ID                             StringId;\r
   EFI_STRING_ID                             LastStringId;\r
   CHAR8                                     AsciiLanguage[ISO_639_2_ENTRY_SIZE + 1];\r
+  CHAR16                                    LanguageCopy[ISO_639_2_ENTRY_SIZE + 1];\r
   BOOLEAN                                   Found;\r
   CHAR8                                     *Rfc3066AsciiLanguage;\r
 \r
@@ -144,8 +145,9 @@ Returns:
 \r
   if (Language != NULL) {\r
     ZeroMem (AsciiLanguage, sizeof (AsciiLanguage));;\r
-    \r
-    UnicodeStrToAsciiStr (Language, AsciiLanguage);\r
+    ZeroMem (LanguageCopy, sizeof (LanguageCopy));\r
+    CopyMem (LanguageCopy, Language, ISO_639_2_ENTRY_SIZE * sizeof (CHAR16));\r
+    UnicodeStrToAsciiStr (LanguageCopy, AsciiLanguage);\r
     Rfc3066AsciiLanguage = ConvertIso639ToRfc3066 (AsciiLanguage);\r
     ASSERT (Rfc3066AsciiLanguage != NULL);\r
   }\r