浏览代码

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 <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>
Chen A Chen 5 年之前
父节点
当前提交
aad4e2ec8f
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      FatPkg/FatPei/Gpt.c

+ 3 - 0
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;