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
This commit is contained in:
Chao Zhang 2014-12-10 08:21:05 +00:00 committed by czhang46
parent 213cc1000e
commit 61959fa9ba
2 changed files with 3 additions and 3 deletions

View File

@ -1021,7 +1021,7 @@ MeasureAllBootVariables (
&BootCount,
(VOID **) &BootOrder
);
if (Status == EFI_NOT_FOUND) {
if (Status == EFI_NOT_FOUND || BootOrder == NULL) {
return EFI_SUCCESS;
}

View File

@ -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;
}