From a8a863a2b3382e78a16923b5f70b77217873ce64 Mon Sep 17 00:00:00 2001 From: eric_tian Date: Thu, 14 Jan 2010 07:25:27 +0000 Subject: [PATCH] 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@9748 6f19259b-4bc3-4df7-8a09-765794883524 --- DuetPkg/FSVariable/FSVariable.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DuetPkg/FSVariable/FSVariable.c b/DuetPkg/FSVariable/FSVariable.c index b68989c3a6..30a21d1e6b 100644 --- a/DuetPkg/FSVariable/FSVariable.c +++ b/DuetPkg/FSVariable/FSVariable.c @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2006 - 2009, Intel Corporation +Copyright (c) 2006 - 2010, Intel Corporation All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -755,7 +755,7 @@ AutoUpdateLangVariable( // Therefore, in variable driver, only store the original value for other use. // AsciiStrnCpy (mGlobal->LangCodes, Data, DataSize); - } else if (StrCmp (VariableName, L"PlatformLang") == 0) { + } else if ((StrCmp (VariableName, L"PlatformLang") == 0) && (DataSize != 0)) { ASSERT (AsciiStrLen (mGlobal->PlatformLangCodes) != 0); // @@ -785,7 +785,7 @@ AutoUpdateLangVariable( ASSERT_EFI_ERROR(Status); - } else if (StrCmp (VariableName, L"Lang") == 0) { + } else if ((StrCmp (VariableName, L"Lang") == 0) && (DataSize != 0)) { ASSERT (AsciiStrLen (mGlobal->LangCodes) != 0); //