diff options
author | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-03-27 03:35:45 +0000 |
---|---|---|
committer | qhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-03-27 03:35:45 +0000 |
commit | b1a4c981ecada2b0043e17f9093b62eedb58611f (patch) | |
tree | 60d9ed4d46dc7075749efbb5fe013f4c22c994e6 /MdeModulePkg/Library/UefiHiiLib | |
parent | 0b09813f57ee1d316aadf6c6edefb5db8d618573 (diff) | |
download | edk2-b1a4c981ecada2b0043e17f9093b62eedb58611f.zip edk2-b1a4c981ecada2b0043e17f9093b62eedb58611f.tar.gz edk2-b1a4c981ecada2b0043e17f9093b62eedb58611f.tar.bz2 |
Fix a minor issue to ensure the converted RFC 3066 language is NULL-terminated.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7967 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library/UefiHiiLib')
-rw-r--r-- | MdeModulePkg/Library/UefiHiiLib/HiiString.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/MdeModulePkg/Library/UefiHiiLib/HiiString.c b/MdeModulePkg/Library/UefiHiiLib/HiiString.c index 13f7e74..333c29f 100644 --- a/MdeModulePkg/Library/UefiHiiLib/HiiString.c +++ b/MdeModulePkg/Library/UefiHiiLib/HiiString.c @@ -553,10 +553,15 @@ ConvertIso639LanguageToRfc3066Language ( )
{
UINTN Index;
+ CHAR8 *Rfc3066Language;
for (Index = 0; Iso639ToRfc3066ConversionTable[Index] != 0; Index += 5) {
if (CompareMem (LanguageIso639, &Iso639ToRfc3066ConversionTable[Index], 3) == 0) {
- return AllocateCopyPool (2, &Iso639ToRfc3066ConversionTable[Index + 3]);
+ Rfc3066Language = AllocateZeroPool (3);
+ if (Rfc3066Language != NULL) {
+ Rfc3066Language = CopyMem (Rfc3066Language, &Iso639ToRfc3066ConversionTable[Index + 3], 2);
+ }
+ return Rfc3066Language;
}
}
|