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 CFC90202E53A1 for ; Sat, 23 Feb 2019 06:20:16 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Feb 2019 06:20:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,404,1544515200"; d="scan'208";a="322783977" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 23 Feb 2019 06:20:13 -0800 Received: from fmsmsx115.amr.corp.intel.com (10.18.116.19) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sat, 23 Feb 2019 06:20:10 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx115.amr.corp.intel.com (10.18.116.19) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sat, 23 Feb 2019 06:20:09 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.102]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.172]) with mapi id 14.03.0415.000; Sat, 23 Feb 2019 22:20:07 +0800 From: "Gao, Liming" To: "Feng, Bob C" , "edk2-devel@lists.01.org" Thread-Topic: [Patch V2] BaseTools: Add parameter check for the AsciiStringToUint64 Thread-Index: AQHUy1wGYApzXHrGCU6tLpbUc3tElaXtbwAA Date: Sat, 23 Feb 2019 14:20:06 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E3E6742@SHSMSX104.ccr.corp.intel.com> References: <20190223094153.29008-1-bob.c.feng@intel.com> In-Reply-To: <20190223094153.29008-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTIzMjU0MGUtNDE1ZC00OGY2LTgxMzQtZDU0MjRkMGQwYmM4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoicTZhSFpUaGlNZExaSHFSWEU3alJJRVpJSjFVYlVlTGpjZHBCaWtSeDFzUHBXQWpiR2lYZUNuWUs3dUZnWWV3aiJ9 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 V2] BaseTools: Add parameter check for the AsciiStringToUint64 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, 23 Feb 2019 14:20:17 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Feng, Bob C > Sent: Saturday, February 23, 2019 5:42 PM > To: edk2-devel@lists.01.org > Cc: Feng, Bob C ; Gao, Liming > Subject: [Patch V2] BaseTools: Add parameter check for the AsciiStringToU= int64 >=20 > If the input parameter AsciiString length is greater > than 255, the GenFv will hang. >=20 > This patch is to fix this issue. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Bob Feng > Cc: Liming Gao > --- > BaseTools/Source/C/Common/ParseInf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/BaseTools/Source/C/Common/ParseInf.c b/BaseTools/Source/C/Co= mmon/ParseInf.c > index 3907f44331..c5d79c89fa 100644 > --- a/BaseTools/Source/C/Common/ParseInf.c > +++ b/BaseTools/Source/C/Common/ParseInf.c > @@ -506,11 +506,11 @@ Returns: > Index =3D 0; >=20 > // > // Check input parameter > // > - if (AsciiString =3D=3D NULL || ReturnValue =3D=3D NULL) { > + if (AsciiString =3D=3D NULL || ReturnValue =3D=3D NULL || strlen(Ascii= String) > 0xFF) { > return EFI_INVALID_PARAMETER; > } > while (AsciiString[Index] =3D=3D ' ') { > Index ++; > } > -- > 2.18.0.windows.1