VarCheckInternalIsHexaDecimalDigitCharacter (VariableName[NameLength + 1]) &&\r
VarCheckInternalIsHexaDecimalDigitCharacter (VariableName[NameLength + 2]) &&\r
VarCheckInternalIsHexaDecimalDigitCharacter (VariableName[NameLength + 3])) {\r
- if (mVarCheckVariableWithWildcardName[Index].VariableProperty.Revision != VAR_CHECK_VARIABLE_PROPERTY_REVISION) {\r
- return NULL;\r
- } else {\r
- return &mVarCheckVariableWithWildcardName[Index].VariableProperty;\r
- }\r
+ return &mVarCheckVariableWithWildcardName[Index].VariableProperty;\r
}\r
}\r
if (StrCmp (mVarCheckVariableWithWildcardName[Index].Name, VariableName) == 0) {\r
- if (mVarCheckVariableWithWildcardName[Index].VariableProperty.Revision != VAR_CHECK_VARIABLE_PROPERTY_REVISION) {\r
- return NULL;\r
- } else {\r
- return &mVarCheckVariableWithWildcardName[Index].VariableProperty;\r
- }\r
+ return &mVarCheckVariableWithWildcardName[Index].VariableProperty;\r
}\r
}\r
}\r
\r
Status = EFI_SUCCESS;\r
\r
+ //\r
+ // Get the pointer of property data for set.\r
+ //\r
Property = VariablePropertyGetFunction (Name, Guid, FALSE);\r
if (Property != NULL) {\r
CopyMem (Property, VariableProperty, sizeof (*VariableProperty));\r
}\r
\r
Property = VariablePropertyGetFunction (Name, Guid, TRUE);\r
- if (Property != NULL) {\r
+ //\r
+ // Also check the property revision before using the property data.\r
+ // There is no property set to this variable(wildcard name)\r
+ // if the revision is not VAR_CHECK_VARIABLE_PROPERTY_REVISION.\r
+ //\r
+ if ((Property != NULL) && (Property->Revision == VAR_CHECK_VARIABLE_PROPERTY_REVISION)) {\r
CopyMem (VariableProperty, Property, sizeof (*VariableProperty));\r
return EFI_SUCCESS;\r
}\r
}\r
\r
Property = VariablePropertyGetFunction (VariableName, VendorGuid, TRUE);\r
- if (Property != NULL) {\r
+ //\r
+ // Also check the property revision before using the property data.\r
+ // There is no property set to this variable(wildcard name)\r
+ // if the revision is not VAR_CHECK_VARIABLE_PROPERTY_REVISION.\r
+ //\r
+ if ((Property != NULL) && (Property->Revision == VAR_CHECK_VARIABLE_PROPERTY_REVISION)) {\r
if ((RequestSource != VarCheckFromTrusted) && ((Property->Property & VAR_CHECK_VARIABLE_PROPERTY_READ_ONLY) != 0)) {\r
DEBUG ((EFI_D_INFO, "Variable Check ReadOnly variable fail %r - %g:%s\n", EFI_WRITE_PROTECTED, VendorGuid, VariableName));\r
return EFI_WRITE_PROTECTED;\r