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.24; helo=mga09.intel.com; envelope-from=hao.a.wu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 32AB321F3C18C for ; Wed, 11 Oct 2017 22:14:56 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2017 22:18:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,364,1503385200"; d="scan'208";a="1204943031" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga001.fm.intel.com with ESMTP; 11 Oct 2017 22:18:24 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 11 Oct 2017 22:18:24 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 11 Oct 2017 22:18:23 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Thu, 12 Oct 2017 13:18:20 +0800 From: "Wu, Hao A" To: "Gao, Liming" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] MdeModulePkg: Update RuntimeDxe Crc32 to check the input parameter Thread-Index: AQHTQxI6Fse10Uv/fkCQfp41OPWW3aLfrMIw Date: Thu, 12 Oct 2017 05:18:19 +0000 Message-ID: References: <1507782349-13060-1-git-send-email-liming.gao@intel.com> In-Reply-To: <1507782349-13060-1-git-send-email-liming.gao@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] MdeModulePkg: Update RuntimeDxe Crc32 to check the input parameter X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 05:14:57 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao Wu Best Regards, Hao Wu > -----Original Message----- > From: Gao, Liming > Sent: Thursday, October 12, 2017 12:26 PM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A > Subject: [Patch] MdeModulePkg: Update RuntimeDxe Crc32 to check the input > parameter >=20 > This is the regression issue. After apply CalculateCrc32(), the parameter > check is missing. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Liming Gao > Cc: Wu Hao A > --- > MdeModulePkg/Core/RuntimeDxe/Crc32.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/MdeModulePkg/Core/RuntimeDxe/Crc32.c > b/MdeModulePkg/Core/RuntimeDxe/Crc32.c > index 3e91e08..c271856 100644 > --- a/MdeModulePkg/Core/RuntimeDxe/Crc32.c > +++ b/MdeModulePkg/Core/RuntimeDxe/Crc32.c > @@ -42,6 +42,10 @@ RuntimeDriverCalculateCrc32 ( > OUT UINT32 *CrcOut > ) > { > + if (Data =3D=3D NULL || DataSize =3D=3D 0 || CrcOut =3D=3D NULL) { > + return EFI_INVALID_PARAMETER; > + } > + > *CrcOut =3D CalculateCrc32 (Data, DataSize); > return EFI_SUCCESS; > } > -- > 2.8.0.windows.1