Revision: 18796
          http://sourceforge.net/p/edk2/code/18796
Author:   vanjeff
Date:     2015-11-16 06:56:27 +0000 (Mon, 16 Nov 2015)
Log Message:
-----------
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 <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/18611

Modified Paths:
--------------
    branches/UDK2015/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c

Modified: branches/UDK2015/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c
===================================================================
--- branches/UDK2015/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c     
2015-11-16 06:55:32 UTC (rev 18795)
+++ branches/UDK2015/MdeModulePkg/Library/VarCheckLib/VarCheckLib.c     
2015-11-16 06:56:27 UTC (rev 18796)
@@ -141,11 +141,19 @@
             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;
+        }
       }
     }
   }


------------------------------------------------------------------------------
Presto, an open source distributed SQL query engine for big data, initially
developed by Facebook, enables you to easily query your data on Hadoop in a 
more interactive manner. Teradata is also now providing full enterprise
support for Presto. Download a free open source copy now.
http://pubads.g.doubleclick.net/gampad/clk?id=250295911&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to