Skip to content

Commit

Permalink
SecurityPkg/DxeImageVerificationLib: Fix memory leaks (CVE-2019-14575)
Browse files Browse the repository at this point in the history
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1608

Pointer HashCtx used in IsCertHashFoundInDatabase() is not freed inside
the while-loop, if it will run more than once.

Cc: Jiewen Yao <[email protected]>
Cc: Chao Zhang <[email protected]>
Signed-off-by: Jian J Wang <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
  • Loading branch information
Jian J Wang authored and mergify[bot] committed Feb 19, 2020
1 parent 578bcdc commit fbb9607
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,9 @@ IsCertHashFoundInDatabase (
goto Done;
}

FreePool (HashCtx);
HashCtx = NULL;

SiglistHeaderSize = sizeof (EFI_SIGNATURE_LIST) + DbxList->SignatureHeaderSize;
CertHash = (EFI_SIGNATURE_DATA *) ((UINT8 *) DbxList + SiglistHeaderSize);
CertHashCount = (DbxList->SignatureListSize - SiglistHeaderSize) / DbxList->SignatureSize;
Expand Down

0 comments on commit fbb9607

Please sign in to comment.