From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=chen.a.chen@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 924242194D3B8 for ; Thu, 31 Jan 2019 18:21:30 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2019 18:21:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,546,1539673200"; d="scan'208";a="315391061" Received: from chenche4.ccr.corp.intel.com ([10.239.9.12]) by fmsmga006.fm.intel.com with ESMTP; 31 Jan 2019 18:21:28 -0800 From: Chen A Chen To: edk2-devel@lists.01.org Cc: Chen A Chen , Ruiyu Ni , Hao Wu Date: Fri, 1 Feb 2019 10:21:27 +0800 Message-Id: <20190201022127.10036-1-chen.a.chen@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 Subject: [PATCH] FatPkg/FatPei/Gpt.c: Fix uninitialized variable issue X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2019 02:21:30 -0000 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 --- 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