Revision: 16497
          http://sourceforge.net/p/edk2/code/16497
Author:   vanjeff
Date:     2014-12-11 02:01:48 +0000 (Thu, 11 Dec 2014)
Log Message:
-----------
Fix potential NULL pointer dereference  issue in TcgDxe & TreeDxe.

(Sync patch r16494 from main trunk.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <[email protected]>
Reviewed-by: Guo Dong <[email protected]>

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

Modified Paths:
--------------
    branches/UDK2014.SP1/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
    branches/UDK2014.SP1/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c

Modified: branches/UDK2014.SP1/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
===================================================================
--- branches/UDK2014.SP1/SecurityPkg/Tcg/TcgDxe/TcgDxe.c        2014-12-10 
08:45:44 UTC (rev 16496)
+++ branches/UDK2014.SP1/SecurityPkg/Tcg/TcgDxe/TcgDxe.c        2014-12-11 
02:01:48 UTC (rev 16497)
@@ -1021,7 +1021,7 @@
              &BootCount,
              (VOID **) &BootOrder
              );
-  if (Status == EFI_NOT_FOUND) {
+  if (Status == EFI_NOT_FOUND || BootOrder == NULL) {
     return EFI_SUCCESS;
   }
 

Modified: branches/UDK2014.SP1/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c
===================================================================
--- branches/UDK2014.SP1/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c      2014-12-10 
08:45:44 UTC (rev 16496)
+++ branches/UDK2014.SP1/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c      2014-12-11 
02:01:48 UTC (rev 16497)
@@ -1245,7 +1245,7 @@
      VarName,
      VarNameLength * sizeof (*VarName)
      );
-  if (VarSize != 0) {
+  if (VarSize != 0 && VarData != NULL) {
     CopyMem (
        (CHAR16 *)VarLog->UnicodeName + VarNameLength,
        VarData,
@@ -1423,7 +1423,7 @@
              &BootCount,
              (VOID **) &BootOrder
              );
-  if (Status == EFI_NOT_FOUND) {
+  if (Status == EFI_NOT_FOUND || BootOrder == NULL) {
     return EFI_SUCCESS;
   }
 


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to