diff options
author | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-01-14 07:16:22 +0000 |
---|---|---|
committer | eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-01-14 07:16:22 +0000 |
commit | 18207db786dad25cd67ea862ed8a18354e9ce43d (patch) | |
tree | 32d8991d6ac9d1dd5648212121b0308cde0cb6d6 /MdeModulePkg/Universal/Variable | |
parent | c7a5da72f0dbf52dbf67195598e93e571c15385a (diff) | |
download | edk2-18207db786dad25cd67ea862ed8a18354e9ce43d.zip edk2-18207db786dad25cd67ea862ed8a18354e9ce43d.tar.gz edk2-18207db786dad25cd67ea862ed8a18354e9ce43d.tar.bz2 |
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
Diffstat (limited to 'MdeModulePkg/Universal/Variable')
-rw-r--r-- | MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c | 4 | ||||
-rw-r--r-- | MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c index ee562d7..6bf1d6e 100644 --- a/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c +++ b/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariable.c @@ -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);
//
diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c index 99fd235..4f0ea3c 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c @@ -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);
//
|