public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] FatPkg/FatPei/Gpt.c: Fix uninitialized variable issue
@ 2019-02-01  2:21 Chen A Chen
  2019-02-02  5:20 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Chen A Chen @ 2019-02-01  2:21 UTC (permalink / raw)
  To: edk2-devel; +Cc: Chen A Chen, Ruiyu Ni, Hao Wu

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 <ray.ni@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Chen A Chen <chen.a.chen@intel.com>
---
 FatPkg/FatPei/Gpt.c | 3 +++
 1 file changed, 3 insertions(+)

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;
 
-- 
2.16.2.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-02-02  5:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-01  2:21 [PATCH] FatPkg/FatPei/Gpt.c: Fix uninitialized variable issue Chen A Chen
2019-02-02  5:20 ` Gao, Liming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox