From 1cce53d38431bbcf9d6eb29a578668ad49b4d9eb Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Fri, 16 Oct 2015 01:31:56 +0000 Subject: MdeModulepkg VarCheckLib: Return NULL when no property set to variable with wildcard name. VarCheckLib has zeroed property for variable with wildcard name and is waiting for property set. The code should return NULL when no property set to variable with wildcard name, but not return the zeroed property that will impact the functionality of SetVariableCheck. The issue does not appear with VarCheckUefiLib linked as the library just has the expected property set. Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jiewen Yao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18611 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Library/VarCheckLib/VarCheckLib.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'MdeModulePkg') diff --git a/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c b/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c index cf001547a5..3d1f8f6f46 100644 --- a/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c +++ b/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c @@ -141,11 +141,19 @@ VariablePropertyGetWithWildcardName ( VarCheckInternalIsHexaDecimalDigitCharacter (VariableName[NameLength + 1]) && VarCheckInternalIsHexaDecimalDigitCharacter (VariableName[NameLength + 2]) && VarCheckInternalIsHexaDecimalDigitCharacter (VariableName[NameLength + 3])) { - return &mVarCheckVariableWithWildcardName[Index].VariableProperty; + if (mVarCheckVariableWithWildcardName[Index].VariableProperty.Revision != VAR_CHECK_VARIABLE_PROPERTY_REVISION) { + return NULL; + } else { + return &mVarCheckVariableWithWildcardName[Index].VariableProperty; + } } } if (StrCmp (mVarCheckVariableWithWildcardName[Index].Name, VariableName) == 0) { - return &mVarCheckVariableWithWildcardName[Index].VariableProperty; + if (mVarCheckVariableWithWildcardName[Index].VariableProperty.Revision != VAR_CHECK_VARIABLE_PROPERTY_REVISION) { + return NULL; + } else { + return &mVarCheckVariableWithWildcardName[Index].VariableProperty; + } } } } -- cgit v1.2.3