Revision: 16494
          http://sourceforge.net/p/edk2/code/16494
Author:   czhang46
Date:     2014-12-10 08:21:05 +0000 (Wed, 10 Dec 2014)
Log Message:
-----------
Fix potential NULL pointer dereference  issue in TcgDxe & TreeDxe.

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

Modified Paths:
--------------
    trunk/edk2/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
    trunk/edk2/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c

Modified: trunk/edk2/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
===================================================================
--- trunk/edk2/SecurityPkg/Tcg/TcgDxe/TcgDxe.c  2014-12-10 08:09:20 UTC (rev 
16493)
+++ trunk/edk2/SecurityPkg/Tcg/TcgDxe/TcgDxe.c  2014-12-10 08:21:05 UTC (rev 
16494)
@@ -1021,7 +1021,7 @@
              &BootCount,
              (VOID **) &BootOrder
              );
-  if (Status == EFI_NOT_FOUND) {
+  if (Status == EFI_NOT_FOUND || BootOrder == NULL) {
     return EFI_SUCCESS;
   }
 

Modified: trunk/edk2/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c
===================================================================
--- trunk/edk2/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c        2014-12-10 08:09:20 UTC 
(rev 16493)
+++ trunk/edk2/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c        2014-12-10 08:21:05 UTC 
(rev 16494)
@@ -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