]> git.proxmox.com Git - mirror_edk2.git/commitdiff
FatPkg/FatPei/Gpt.c: Fix uninitialized variable issue
authorChen A Chen <chen.a.chen@intel.com>
Fri, 1 Feb 2019 02:21:27 +0000 (10:21 +0800)
committerLiming Gao <liming.gao@intel.com>
Sat, 2 Feb 2019 13:41:15 +0000 (21:41 +0800)
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>
Reviewed-by: Liming Gao <liming.gao@intel.com>
FatPkg/FatPei/Gpt.c

index c3afb668d7f5f2b19013757234a3bb9e7bfc66f8..bba33c5bfd0d7cb8019ca28000045e932b526638 100644 (file)
@@ -244,6 +244,9 @@ PartitionCheckGptEntryArray (
   UINTN                           Index2;\r
   EFI_PARTITION_ENTRY             *Entry;\r
 \r
+  PartitionEntryBuffer = NULL;\r
+  PartitionEntryStatus = NULL;\r
+\r
   ParentBlockDev  = &(PrivateData->BlockDevice[ParentBlockDevNo]);\r
   Found           = FALSE;\r
 \r