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 <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
  • Loading branch information
jwang36 authored and mergify[bot] committed Feb 19, 2020
1 parent 578bcdc commit fbb9607
Showing 1 changed file with 3 additions and 0 deletions.
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.