]> git.proxmox.com Git - mirror_edk2.git/commitdiff
add DataSize check to avoid PlatformLang/Lang variable is auto-mapped when try to...
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 14 Jan 2010 07:25:27 +0000 (07:25 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 14 Jan 2010 07:25:27 +0000 (07:25 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9748 6f19259b-4bc3-4df7-8a09-765794883524

DuetPkg/FSVariable/FSVariable.c

index b68989c3a6d4502896b3c9ba99679c28841da7fd..30a21d1e6be645ec43860a2f2fd8f2e17f8b7a06 100644 (file)
@@ -1,6 +1,6 @@
 /*++\r
 \r
-Copyright (c) 2006 - 2009, Intel Corporation\r
+Copyright (c) 2006 - 2010, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -755,7 +755,7 @@ AutoUpdateLangVariable(
     // Therefore, in variable driver, only store the original value for other use.\r
     //\r
     AsciiStrnCpy (mGlobal->LangCodes, Data, DataSize);\r
-  } else if (StrCmp (VariableName, L"PlatformLang") == 0) {\r
+  } else if ((StrCmp (VariableName, L"PlatformLang") == 0) && (DataSize != 0)) {\r
     ASSERT (AsciiStrLen (mGlobal->PlatformLangCodes) != 0);\r
 \r
     //\r
@@ -785,7 +785,7 @@ AutoUpdateLangVariable(
 \r
     ASSERT_EFI_ERROR(Status);\r
     \r
-  } else if (StrCmp (VariableName, L"Lang") == 0) {\r
+  } else if ((StrCmp (VariableName, L"Lang") == 0) && (DataSize != 0)) {\r
     ASSERT (AsciiStrLen (mGlobal->LangCodes) != 0);\r
 \r
     //\r