From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web09.5028.1649420340249110179 for ; Fri, 08 Apr 2022 05:19:00 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=HHISQIc1; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: jiewen.yao@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649420340; x=1680956340; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=NRSqQ2qaSDZlIeOyO0mxue1DMbrhAYUE/MpQwY7h8V0=; b=HHISQIc1ACXdcXNGitbDQoKTqlXSyUnAdaJ1H6jLkQ4wdwrnCYXpx385 suqNS/BTQo1YNvPYOM7xN0Bn6u3AJnKpR0qhlBdGp7XEcGMXOHdWoRsPc xckNn4MPpYns3PKm0mg6g3uowdWsb4PG95MB5mepku1dIWRnExW7qmjgO zZbCvRVn2tuxP0mAOKAvmTiZpd0A9/D16Qhr0q11ieyDOelCtfBdgNEtT 6TNWwRHoj9paMaKmbUVFOd9lIAAnR/59OwXQ00mPd+EQCxi4Y8KbzQlyc opnqLLY+XbSFrCWnlwokISXem11hB0NUTOgY3zN6MgBcxX4/ebP5sWgOb g==; X-IronPort-AV: E=McAfee;i="6400,9594,10310"; a="322268336" X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="322268336" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2022 05:18:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,245,1643702400"; d="scan'208";a="609737376" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga008.fm.intel.com with ESMTP; 08 Apr 2022 05:18:34 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 8 Apr 2022 05:18:33 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Fri, 8 Apr 2022 05:18:33 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Fri, 8 Apr 2022 05:18:33 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.109) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Fri, 8 Apr 2022 05:18:33 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jmadSzfK85b8aW7ZBTCzX5+XuSlFZdD4xRnGCL+QJOyi+KGZx0A8yNh/wnrePQNlQ74gVreMrDaafircRf1d/ZQsmRUSDdpeP7mTwfSEF1D/CymHrOUTZz82Op8JDwhZ9+L5MYMyIxYbopa9nYgMwr0rS2eiV3C2aBPqQ4Dj3rwS/aKVlpMuqI0zYAjb9YuIaCwJZjWwmdGAr7D2lcF1wRXUz4wTPSY57epgQ8vlQ6gBLpUaf7qMXeOSbctqOiG+LVnrxj5gwm0dVLteBw+Tap55eVb1MtnEZAfiyoXRc1YFmeddWY0adhsd1tYhkpPPkdYXn/4VQ9/0TAUTAiv/rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=V+C/i1izYWHi740vPBdIenNH+CbH3Vi7Ab5MB8qWERg=; b=UQ79VmABGm56fB95YC+OWGSfPmBGpqKob2xHmmx+QRww0XN6Is/KPL5vJC/orr0K7YSc/9xdQ4692P23i6W3uBgViVs26n/S4askr4OJIRapvFGecihi+6DeG7MqoS1t+nsgruMcCHYLOlbCUF8559fMkAI3o3KWLdAwoPw/s3P+hxsUIdXdqCHNKB8YOR4AMD2qLAjIrDg1D81fgzT5PUSCK8XNd7n2K0SifvFjjRXs/Ueg+w5sOqSmYrYyt7NTLg3GOx9wUTOJ0DM0G7JPez0pKEIKwKdC9Wx+RmH9ev4Ud0g/iMBAsQ6SCFVe6UZnMQRcZZlFtoT1oBVEOpL71g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by PH0PR11MB4933.namprd11.prod.outlook.com (2603:10b6:510:33::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 12:18:17 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::198e:ea23:c83b:b93a]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::198e:ea23:c83b:b93a%4]) with mapi id 15.20.5144.026; Fri, 8 Apr 2022 12:18:17 +0000 From: "Yao, Jiewen" To: Gerd Hoffmann , "devel@edk2.groups.io" CC: Oliver Steffen , "Jiang, Guomin" , "Wang, Jian J" , Xiaoyu Lu , Pawel Polawski Subject: Re: [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy Thread-Topic: [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy Thread-Index: AQHYSzoovlO5DkrEO0mGjvDLm0+NGazl7tEA Date: Fri, 8 Apr 2022 12:18:17 +0000 Message-ID: References: <20220408111622.3519517-1-kraxel@redhat.com> <20220408111622.3519517-8-kraxel@redhat.com> In-Reply-To: <20220408111622.3519517-8-kraxel@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.401.20 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a2ee0bf2-d808-4c09-10a1-08da1959dcce x-ms-traffictypediagnostic: PH0PR11MB4933:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: N25BCKqeRqYi+nYAh7ivzUgsSftxhHMEdRqbtZnv/GAU9h1KbI1WFVD7OtzgWTusPX1KaLUjYlEZkc83iHGSfPe4/NjxY8pMIQyMc53Jl2z9AzuPEGKTv0XwBUb1dF9mhSjObVCA6EFVG7vNOVKevv+30R+t5aqGE9eJkpfEHVaZZwP7H7o/t1aH8At5i6Xa0ht69/IBi88/zdO8fvI5SPIjH2WfmhP5g125Nd9IhaVfMACMgAhNgrlDY++8RAljC2oon0Ar5PBZ4N8RWMB1rQJd+nTC105uDekc8Am6gJwPGFtn1AUGAkYimfX97CtrdVI0Y5zN14AbiWiYDZDkiye9sDCS5FWnz4ydNqdGJuSY+jUDUcvPE0e29VNYC7aSDlTb6TTQf5s82MPkEl/YGlSzzCOrnvKjfGS87H9itOnG4jsQ/URcsAsVkoWiU35UrLzHT5WjOpk3+vtXNQDO7ikSTgO3Wp22bM40sehtEnwtMRhGVJHkY/eGA1INEx1zcs2mP/tOE0nnW7DV/TBFUx6RjCpY6x/iNjq5iAMy0fkexlAvL3/un9RJZPD5Ab0cuheszZIwJPDe3W86qdxffwnDTPldsbYuyFNPlzX5duq1MxjrQfOHmpdaZvIm6x85efwUE5rihsc/lBLvr52IOGPhKph2MsVhDQsYkolj/K1JiqrXDnHMVsurxX5r+XFlt1jy3NNz9PJvcaInGMA1QQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5872.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(186003)(508600001)(66556008)(38100700002)(83380400001)(2906002)(8936002)(7696005)(55016003)(53546011)(6506007)(52536014)(66946007)(86362001)(5660300002)(71200400001)(66476007)(38070700005)(54906003)(110136005)(64756008)(76116006)(66446008)(8676002)(33656002)(4326008)(26005)(122000001)(316002)(82960400001)(9686003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?CyQysUpCavopWSvz7t4gtF5KCsXyY2Fm7DsMCE6YmCmrjKK3fK9CI9L4Upuz?= =?us-ascii?Q?0RbId5f3oe0SGj82xrZFBpYMh+dtO45WUk6vzHSqKsCIej95rgxp86f2HQM0?= =?us-ascii?Q?OniNf4EnLC3srvUc3/Ry/9YJlsc4r9tH8vMgk4Ln97QK3TYEqLgXf0jMX3Z0?= =?us-ascii?Q?AtNrrO732yu0Mej94lm0bLplo/x2cf9bpL6gspUytGdJseE2aPDhN3H0sYBU?= =?us-ascii?Q?WVtY18MJ5/10LIN0A6tmKgWT+7XJaoZ5KhTwhF7u75TCtdsgfoe25TdGn5KX?= =?us-ascii?Q?hrwZIo/jHNf/krMBOxg+VNm5orBGOC/BkaMsulOE+wUZNUG6OkGHK+ogG9Za?= =?us-ascii?Q?/rUQvMTL8qRec4DTOFF5bHiw2lAm8Nhj42U7BOZysNlZumi3dx5WVBBFzpEv?= =?us-ascii?Q?E5KXKFBfgz8QdZ0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?us-ascii?Q?+dZhyFJ7LOG6RyIyGqGr9JDfjMlSClbWfAV9g/WoYadQSIbTOue7oz3Lw3O7?= =?us-ascii?Q?kox/DS764fTmrvqzcz6c1Xpsi2RWAQRtFNJZ+uKirTw79Wg9iayKtXaSvKhW?= =?us-ascii?Q?vVazII770/wQUrXThXB2S/m7xexs7ShCm8h5XTT0FZgBpOQijFtI/L8T9S78?= =?us-ascii?Q?6MACIsrQiIHHIjqr50D1JyIrxpLc/tQZqs9meCGntrwRcWoshj+n/6C0TMOM?= =?us-ascii?Q?4mpAOLjZXbJlHsK59+MWplaPfDPPK3QK0zShH5eEAvaLYsI2d9W3qNDl0vKO?= =?us-ascii?Q?yrBb+lpcYqpnfgGl2UoAFeNez5nwZycntq/de+rKG4PoCdEcoLESBeoFLOrW?= =?us-ascii?Q?HvtuCoIv60YEqHnBzsZkXEKAxdNDCcofe/ayIDAIPO/ZUaM8L5Vg9oiniY/c?= =?us-ascii?Q?2+d4cgXEdg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2ee0bf2-d808-4c09-10a1-08da1959dcce X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Apr 2022 12:18:17.2841 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jv+Ajzyqxi0yFGle1QUs5AjoRiekLNJxv4+VZVg7dI8kb1WTc/CzJMNwHemchSYh+HPMdUjN5JG1JygVjRgjiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4933 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Can we remove inline keyword? I don't think it is really needed in EDKII project. Thank you Yao Jiewen > -----Original Message----- > From: Gerd Hoffmann > Sent: Friday, April 8, 2022 7:16 PM > To: devel@edk2.groups.io > Cc: Oliver Steffen ; Yao, Jiewen > ; Jiang, Guomin ; Wang, Jia= n > J ; Xiaoyu Lu ; Pawel Polaws= ki > ; Gerd Hoffmann > Subject: [PATCH v2 7/8] CryptoPkg/CrtLibSupport: fix strcpy >=20 > strcpy() returns a pointer to the destination string, AsciiStrCpyS() > does not. So a simple #define does not work. Create a inline function > instead. >=20 > Signed-off-by: Gerd Hoffmann > --- > CryptoPkg/Library/Include/CrtLibSupport.h | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) >=20 > diff --git a/CryptoPkg/Library/Include/CrtLibSupport.h > b/CryptoPkg/Library/Include/CrtLibSupport.h > index 287d7f76bfb3..7c1bc7755b1c 100644 > --- a/CryptoPkg/Library/Include/CrtLibSupport.h > +++ b/CryptoPkg/Library/Include/CrtLibSupport.h > @@ -395,6 +395,16 @@ inet_pton ( > void * > ); >=20 > +static inline char * > +strcpy ( > + char *restrict strDest, > + const char *strSource > + ) > +{ > + AsciiStrCpyS (strDest, MAX_STRING_SIZE, strSource); > + return strDest; > +} > + > // > // Macros that directly map functions to BaseLib, BaseMemoryLib, and > DebugLib functions > // > @@ -404,7 +414,6 @@ inet_pton ( > #define memcmp(buf1, buf2, count) > (int)(CompareMem(buf1,buf2,(UINTN)(count))) > #define memmove(dest, source, count) > CopyMem(dest,source,(UINTN)(count)) > #define strlen(str) (size_t)(AsciiStrnLenS(str,M= AX_STRING_SIZE)) > -#define strcpy(strDest, strSource) > AsciiStrCpyS(strDest,MAX_STRING_SIZE,strSource) > #define strncpy(strDest, strSource, count) > AsciiStrnCpyS(strDest,MAX_STRING_SIZE,strSource,(UINTN)count) > #define strcat(strDest, strSource) > AsciiStrCatS(strDest,MAX_STRING_SIZE,strSource) > #define strncmp(string1, string2, count) > (int)(AsciiStrnCmp(string1,string2,(UINTN)(count))) > -- > 2.35.1