summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2015-11-16 06:56:27 +0000
committervanjeff <vanjeff@Edk2>2015-11-16 06:56:27 +0000
commitdbe8eed088d1aac38ea0bd65da053798b1dc4d20 (patch)
treea065626e3e925f9b07266979fdd8a0b6c14b0b40 /MdeModulePkg/Library
parentfe25f37f5c000eb72fb325173dd9bb733689cb56 (diff)
downloadedk2-platforms-dbe8eed088d1aac38ea0bd65da053798b1dc4d20.tar.xz
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. (Sync patch r18611 from main trunk.) Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/branches/UDK2015@18796 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Library')
-rw-r--r--MdeModulePkg/Library/VarCheckLib/VarCheckLib.c12
1 files changed, 10 insertions, 2 deletions
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;
+ }
}
}
}