From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 6B88821E1DAE5 for ; Wed, 2 Aug 2017 10:35:14 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2017 10:37:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,312,1498546800"; d="scan'208";a="1158307479" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by orsmga001.jf.intel.com with ESMTP; 02 Aug 2017 10:37:24 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.9]) by ORSMSX104.amr.corp.intel.com ([169.254.4.205]) with mapi id 14.03.0319.002; Wed, 2 Aug 2017 10:37:23 -0700 From: "Kinney, Michael D" To: Felix Poludov , "edk2-devel@lists.01.org" , "Kinney, Michael D" Thread-Topic: [PATCH] staging/edk2-test: TestProfile bug fix Thread-Index: AdMLliB1oQjf9HLxQm2/4t1/wUUYRAAH71Fw Date: Wed, 2 Aug 2017 17:37:23 +0000 Message-ID: References: <9333E191E0D52B4999CE63A99BA663A00302B394D6@atlms1.us.megatrends.com> In-Reply-To: <9333E191E0D52B4999CE63A99BA663A00302B394D6@atlms1.us.megatrends.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Subject: Re: [PATCH] staging/edk2-test: TestProfile bug fix 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: Wed, 02 Aug 2017 17:35:14 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Felix, Thanks for the contribution. Do you have a test case that reproduces the issue you found? Thanks, Mike > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On > Behalf Of Felix Poludov > Sent: Wednesday, August 2, 2017 6:54 AM > To: edk2-devel@lists.01.org > Subject: [edk2] [PATCH] staging/edk2-test: TestProfile bug fix >=20 > The patch is a bug fix for TestFrameworkPkg/Support/TestProfile > driver. > AsciiStrCpy function was used to copy overlapping strings, which > triggered an ASSERT. >=20 > The function was used on overlapping strings in a couple of > places: > 1. _alltrim: AsciiStrCpy is replaced with CopyMem, which can > handle overlapping buffers > 2. _prosessLine: AsciiStrCpy at the beginning of the function is > removed. > The call was redundant. The function was trying to move the data > that have already been moved by _alltrim. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Felix Polyudov > --- >=20 > diff --git a/TestFrameworkPkg/Support/TestProfile/TestProfile.c > b/TestFrameworkPkg/Support/TestProfile/TestProfile.c > index f02e9df..3f0e0d5 100644 > --- a/TestFrameworkPkg/Support/TestProfile/TestProfile.c > +++ b/TestFrameworkPkg/Support/TestProfile/TestProfile.c > @@ -269,7 +269,7 @@ Routine Description: > } > tmp[Index] =3D '\0'; > - AsciiStrCpy (ptrStr, tmp); > + CopyMem(ptrStr, tmp, Index+1); > return ptrStr; > } > @@ -419,7 +419,7 @@ Routine Description: > CHAR8 ptrValue[MAX_STRING_LEN + 1]; > INI *ptrItem; > - AsciiStrCpy (ptrLine, _alltrim (ptrLine)); > + _alltrim (ptrLine); > if (*ptrLine =3D=3D '#') { > // it's a comment line >=20 >=20 > Please consider the environment before printing this email. >=20 > The information contained in this message may be confidential > and proprietary to American Megatrends, Inc. This communication > is intended to be read only by the individual or entity to whom > it is addressed or by their designee. If the reader of this > message is not the intended recipient, you are on notice that > any distribution of this message, in any form, is strictly > prohibited. Please promptly notify the sender by reply e-mail > or by telephone at 770-246-8600, and then delete or destroy all > copies of the transmission. > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel