add DataSize check to avoid PlatformLang/Lang variable is auto-mapped when try to delete these variables.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9746 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
eric_tian 2010-01-14 07:16:22 +00:00
parent c7a5da72f0
commit 18207db786
2 changed files with 4 additions and 4 deletions

View File

@ -574,7 +574,7 @@ AutoUpdateLangVariable(
// Therefore, in variable driver, only store the original value for other use.
//
AsciiStrnCpy (mVariableModuleGlobal->LangCodes, Data, DataSize);
} else if (StrCmp (VariableName, L"PlatformLang") == 0) {
} else if ((StrCmp (VariableName, L"PlatformLang") == 0) && (DataSize != 0)) {
ASSERT (AsciiStrLen (mVariableModuleGlobal->PlatformLangCodes) != 0);
//
@ -604,7 +604,7 @@ AutoUpdateLangVariable(
ASSERT_EFI_ERROR(Status);
} else if (StrCmp (VariableName, L"Lang") == 0) {
} else if ((StrCmp (VariableName, L"Lang") == 0) && (DataSize != 0)) {
ASSERT (AsciiStrLen (mVariableModuleGlobal->LangCodes) != 0);
//

View File

@ -1254,7 +1254,7 @@ AutoUpdateLangVariable(
// Therefore, in variable driver, only store the original value for other use.
//
AsciiStrnCpy (mVariableModuleGlobal->LangCodes, Data, DataSize);
} else if (StrCmp (VariableName, L"PlatformLang") == 0) {
} else if ((StrCmp (VariableName, L"PlatformLang") == 0) && (DataSize != 0)) {
ASSERT (AsciiStrLen (mVariableModuleGlobal->PlatformLangCodes) != 0);
//
@ -1284,7 +1284,7 @@ AutoUpdateLangVariable(
ASSERT_EFI_ERROR(Status);
} else if (StrCmp (VariableName, L"Lang") == 0) {
} else if ((StrCmp (VariableName, L"Lang") == 0) && (DataSize != 0)) {
ASSERT (AsciiStrLen (mVariableModuleGlobal->LangCodes) != 0);
//