]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulepkg VarCheckLib: Return NULL when no property set
authorStar Zeng <star.zeng@intel.com>
Fri, 16 Oct 2015 01:31:56 +0000 (01:31 +0000)
committerlzeng14 <lzeng14@Edk2>
Fri, 16 Oct 2015 01:31:56 +0000 (01:31 +0000)
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 <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/trunk/edk2@18611 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Library/VarCheckLib/VarCheckLib.c

index cf001547a509f01848ac7f036bc6cafe6bb55ae1..3d1f8f6f4698aa6d9e5e8c19d08b0899e92546d4 100644 (file)
@@ -141,11 +141,19 @@ VariablePropertyGetWithWildcardName (
             VarCheckInternalIsHexaDecimalDigitCharacter (VariableName[NameLength + 1]) &&\r
             VarCheckInternalIsHexaDecimalDigitCharacter (VariableName[NameLength + 2]) &&\r
             VarCheckInternalIsHexaDecimalDigitCharacter (VariableName[NameLength + 3])) {\r
-          return &mVarCheckVariableWithWildcardName[Index].VariableProperty;\r
+          if (mVarCheckVariableWithWildcardName[Index].VariableProperty.Revision != VAR_CHECK_VARIABLE_PROPERTY_REVISION) {\r
+            return NULL;\r
+          } else {\r
+            return &mVarCheckVariableWithWildcardName[Index].VariableProperty;\r
+          }\r
         }\r
       }\r
       if (StrCmp (mVarCheckVariableWithWildcardName[Index].Name, VariableName) == 0) {\r
-        return  &mVarCheckVariableWithWildcardName[Index].VariableProperty;\r
+        if (mVarCheckVariableWithWildcardName[Index].VariableProperty.Revision != VAR_CHECK_VARIABLE_PROPERTY_REVISION) {\r
+          return NULL;\r
+        } else {\r
+          return  &mVarCheckVariableWithWildcardName[Index].VariableProperty;\r
+        }\r
       }\r
     }\r
   }\r