From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 002BE211C7F0E for ; Fri, 1 Feb 2019 21:20:34 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2019 21:20:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,551,1539673200"; d="scan'208";a="130957361" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga002.jf.intel.com with ESMTP; 01 Feb 2019 21:20:33 -0800 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 1 Feb 2019 21:20:33 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Fri, 1 Feb 2019 21:20:32 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.102]) by shsmsx102.ccr.corp.intel.com ([169.254.2.207]) with mapi id 14.03.0415.000; Sat, 2 Feb 2019 13:20:30 +0800 From: "Gao, Liming" To: "Chen, Chen A" , "edk2-devel@lists.01.org" CC: "Wu, Hao A" Thread-Topic: [edk2] [PATCH] FatPkg/FatPei/Gpt.c: Fix uninitialized variable issue Thread-Index: AQHUudTwjR3Rg+++r0Ox+j0Xl/xHD6XL+lBw Date: Sat, 2 Feb 2019 05:20:30 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E3D5000@SHSMSX104.ccr.corp.intel.com> References: <20190201022127.10036-1-chen.a.chen@intel.com> In-Reply-To: <20190201022127.10036-1-chen.a.chen@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiODJmM2QxODItMTI5NS00OTk1LWEzMDktN2IzZDM1NmUwMjJjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiYjQwTXpHN3F0WlB1dk5sdDJSQTcyQlloU1kySE1DWWJiRzVRZVwvbm9jN2h1XC9tdXIyZ2dCRFwvcm5QcnVNXC9KMlgifQ== dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Sat, 02 Feb 2019 05:20:35 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Ch= en A Chen > Sent: Friday, February 1, 2019 10:21 AM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A > Subject: [edk2] [PATCH] FatPkg/FatPei/Gpt.c: Fix uninitialized variable i= ssue >=20 > 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. >=20 > 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(+) >=20 > 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; >=20 > + PartitionEntryBuffer =3D NULL; > + PartitionEntryStatus =3D NULL; > + > ParentBlockDev =3D &(PrivateData->BlockDevice[ParentBlockDevNo]); > Found =3D FALSE; >=20 > -- > 2.16.2.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel