summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Zhang <chao.b.zhang@intel.com>2014-12-10 08:21:05 +0000
committerczhang46 <czhang46@Edk2>2014-12-10 08:21:05 +0000
commit61959fa9baeed976adefa2043390f2ad208d894e (patch)
tree2bcc6b6556ee4889a08cbb8f558377c0cf60abe8
parent213cc1000e6af3c90aefdef2f0f9d5aa99f758d1 (diff)
downloadedk2-61959fa9baeed976adefa2043390f2ad208d894e.tar.gz
edk2-61959fa9baeed976adefa2043390f2ad208d894e.tar.bz2
edk2-61959fa9baeed976adefa2043390f2ad208d894e.zip
Fix potential NULL pointer dereference issue in TcgDxe & TreeDxe.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16494 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--SecurityPkg/Tcg/TcgDxe/TcgDxe.c2
-rw-r--r--SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
index bf9c7521aa..282505dbc7 100644
--- a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
+++ b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
@@ -1021,7 +1021,7 @@ MeasureAllBootVariables (
&BootCount,
(VOID **) &BootOrder
);
- if (Status == EFI_NOT_FOUND) {
+ if (Status == EFI_NOT_FOUND || BootOrder == NULL) {
return EFI_SUCCESS;
}
diff --git a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c
index 2f159e0c6b..54e505d136 100644
--- a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c
+++ b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c
@@ -1245,7 +1245,7 @@ MeasureVariable (
VarName,
VarNameLength * sizeof (*VarName)
);
- if (VarSize != 0) {
+ if (VarSize != 0 && VarData != NULL) {
CopyMem (
(CHAR16 *)VarLog->UnicodeName + VarNameLength,
VarData,
@@ -1423,7 +1423,7 @@ MeasureAllBootVariables (
&BootCount,
(VOID **) &BootOrder
);
- if (Status == EFI_NOT_FOUND) {
+ if (Status == EFI_NOT_FOUND || BootOrder == NULL) {
return EFI_SUCCESS;
}