From aad4e2ec8ffe2aae6bdcdd04f34a1d3b0bf2c4a9 Mon Sep 17 00:00:00 2001 From: Chen A Chen Date: Fri, 1 Feb 2019 10:21:27 +0800 Subject: FatPkg/FatPei/Gpt.c: Fix uninitialized variable issue Uninitialized pointer variable may randomly point to a block of memory. In This case, FreePool function will free a block of memory that is not belongs to this function. Cc: Ruiyu Ni Cc: Hao Wu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen Reviewed-by: Liming Gao --- FatPkg/FatPei/Gpt.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'FatPkg') diff --git a/FatPkg/FatPei/Gpt.c b/FatPkg/FatPei/Gpt.c index c3afb668d7..bba33c5bfd 100644 --- a/FatPkg/FatPei/Gpt.c +++ b/FatPkg/FatPei/Gpt.c @@ -244,6 +244,9 @@ PartitionCheckGptEntryArray ( UINTN Index2; EFI_PARTITION_ENTRY *Entry; + PartitionEntryBuffer = NULL; + PartitionEntryStatus = NULL; + ParentBlockDev = &(PrivateData->BlockDevice[ParentBlockDevNo]); Found = FALSE; -- cgit v1.2.3