From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F2E2F42C0E; Fri, 2 Jun 2023 08:05:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DCA67406B8; Fri, 2 Jun 2023 08:05:11 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id B36F640695 for ; Fri, 2 Jun 2023 08:05:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685685910; x=1717221910; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=8JC44IvSzk9lQEk9P3Qa8PhaoKx9YS+QE2ofgHqmbpU=; b=A6m0/rvQBVBtNaZMxSM8BkqQJZvSrtgvciq3exQqyc7mDe3PAWKOKfho 6IKBSlqNGbswtTE8qdn9ZtXBhx622JuamzqKgppIASncy+gXrteVOqj5O HSTpLjCFOZdQTdXa9lj7PgDPOKgH56hGFoJH5SuV25SVRu10lfHMV85LK 0/7r6SQa3IwV8hNH6NNWFZMmq4xH2MV1ZntJfZchP0K7bL+OemKP/yR/M rVU7KhyrrSuQXim8n98Ik8mBnfBm3eg9ksnyC2cc7uKoRBKKTT+cqVD1G MkeOrYXVNsCPUmKlZS5dviPPMz0WlqkyjdK9lw+WVwHNqYg3CnnqI7Elh Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="384062506" X-IronPort-AV: E=Sophos;i="6.00,212,1681196400"; d="scan'208";a="384062506" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Jun 2023 23:04:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10728"; a="707704749" X-IronPort-AV: E=Sophos;i="6.00,212,1681196400"; d="scan'208";a="707704749" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by orsmga002.jf.intel.com with ESMTP; 01 Jun 2023 23:04:52 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Thu, 1 Jun 2023 23:04:51 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Thu, 1 Jun 2023 23:04:51 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.48) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Thu, 1 Jun 2023 23:04:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CpZvl5BLSMqD9O6h99CFm+wA+6tqVdS+Ufj5tUG3B0t9Jt0eYyCJMT6TQei8Fhf9soXvTGJxP6EKtRT1f57KTJt+2BTfw+zMc0Ri3KrEKHL/VyP6zhemvP1S8WqVUa3vnpiULTZbv1MPWMWRIJIHkC3EX+dYPvXWbHmIzlkCJPIUrBrX2jDVmQx2TVpsSJ1bDPvLLZ+Qhx5WHfASZNor8mNiE5fsXPYfy5pO2akGDgYYw4eNDGvUWBXhYAa3GoYh070XOzVlY3HAMkSYBU3P81GEj6jL058CWQ8GoKLkgB0Ap0sHPUf2MWespIMnp24eFYESLtT8VzP2EGux2a/Cgg== 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=WQy1ZxeOPJA9CbwbFcq1NNbFvwJ8XA4ceWQsOxavJKQ=; b=ndhoo7BhOGAkgNtPviuJCfkxJevuzhdql0odLAVL5VpNP0/AwfGIms9koJsNfoTF0NGIlD7iCd50g5qXvABr3FzHPfpJAwyTACMMw2Jym0+cMO3jM0azDUJ08TPiWvhPJFKeYBFd3qYTpz6NYTH4Lo6DboX9BO89QAB2+H596PBMOgtzl2c6T0KKJJCQ3a7wkjmP7s6S2mBP43jMmdZ84LlyRKnRaFaW8P1SWXBn1+34wz73BDH7GAGwMNvvVgXKvlGftVa4xYj28Np4j6moXOqfw/maK/eWkqNJOAdtI6IZ6FOJ63PVJyLcq4GzrqvbQzxjnRCWLJTnwFJwv+wpoA== 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 DM6PR11MB4252.namprd11.prod.outlook.com (2603:10b6:5:201::26) by SA1PR11MB8328.namprd11.prod.outlook.com (2603:10b6:806:376::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Fri, 2 Jun 2023 06:04:49 +0000 Received: from DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::29af:3256:60ce:a172]) by DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::29af:3256:60ce:a172%3]) with mapi id 15.20.6433.022; Fri, 2 Jun 2023 06:04:48 +0000 From: "Xu, Rosen" To: Stephen Hemminger , "dev@dpdk.org" CC: "Zhang, Tianfei" Subject: RE: [PATCH 04/25] raw/ifpga: replace snprintf with strlcpy Thread-Topic: [PATCH 04/25] raw/ifpga: replace snprintf with strlcpy Thread-Index: AQHZlJoO6QtZ1NALfkWmqCBRzylIk693BwEQ Date: Fri, 2 Jun 2023 06:04:48 +0000 Message-ID: References: <20230601150106.18375-1-stephen@networkplumber.org> <20230601150106.18375-5-stephen@networkplumber.org> In-Reply-To: <20230601150106.18375-5-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4252:EE_|SA1PR11MB8328:EE_ x-ms-office365-filtering-correlation-id: e1bb1d22-ed58-45e9-ca24-08db632f459b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ij+V99awXA2dJ1Svq08m2exOqRPSi+uXQKUsZBzzqjHxZ4p9bp91ee6GFpgY+wT+HjBoZ9/fdsT8or2IYr1PGdE83g9In12qSUFA+tmRF6zvas37l9yEZk8L0zu8oiFb/IdfxPFfPzsS1NPj3yIbRWLcZv1Gmee+n6u5/F+CoEyW1ci0jIvwi4idPzRnu+loj2V6Rd7Phu2dX4BVO+Pb9ksluPSxFtKroAC3uTYifzgrJQ7OWfAfSrgRBBCc1/PQe9G1LAg/LzLrdUHFFLlID8LTaCevRjwsH/R3klqap+1aH6c8OfV3S7sGshL93xyFkmQtn0ous4zwgPDOluoZ/TLOdRL/21uHPE7MounIs9N0SMoc1Tj8+r831BasB3qQoaN5768S4Flmbsk0EePul2i5ytrvvjKu98m+tw0G6fHv4FJ4QO37rD5jPb1euIzGlbIRvwsHpvUJHlC4gh/mf+XmsPgjXAsYH/j7grK0p7pElyMIiqpUgnG4MvaVRMw2dkslN+vxhUqlaVt8ufgJPyMfYd9jtaWtoG1I4omk5S7ohPS3hPCMFETIxPqYUInf9CCuJ/3FqYVrMmgpMg28/jtiVobLtRWQB+6s2yNosCfeo1FFG1eDKM7xFaKDBOPg2m8R7LeJAPNRjch6t4N2xw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4252.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(136003)(376002)(346002)(366004)(39860400002)(451199021)(478600001)(55016003)(5660300002)(186003)(83380400001)(33656002)(52536014)(7696005)(86362001)(2906002)(8676002)(8936002)(4326008)(82960400001)(122000001)(41300700001)(316002)(38100700002)(38070700005)(6506007)(26005)(71200400001)(107886003)(66556008)(66946007)(76116006)(9686003)(110136005)(64756008)(66476007)(66446008)(53546011)(156123004); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?DLKlGQfR6u8sQ+maQBgyrbGzSwGfEdnYfHjUxKA/P65Glr1XfiniNZKVLta9?= =?us-ascii?Q?pZsBHQ6UHjf3adNksxgSFf3S44twoTv8LdEzO70IYsLdxDjVPWieAqhzegcY?= =?us-ascii?Q?q3IzW2MSjqL8TD8vBKgy9OHHDUCbbue6gPjYUOTSI5A82efy8lyaup19tz4A?= =?us-ascii?Q?tWoWaVB/RUGZY8fngBrx4Wc+6KqMNVi/EEoPs/ahttw9v6B6VB1RKRsmUJ79?= =?us-ascii?Q?Zfkmire7UcqlCnBL7ZsMmlhZ2rKhD4q9bFvo4gwUd4/ydpqUQXrnyxtJudFG?= =?us-ascii?Q?wvFcbAGYBeaePGABGVvpjcv0oDk2XyTLvHW1OluJyEQ8d6Dsd4PCH7cwLArA?= =?us-ascii?Q?Hhr6HWxdeU3+BRPI7Mbr3gfmH7zYMhcfRJlRQVZbggWLlVEbAvQ5r9CkV0CU?= =?us-ascii?Q?Esy9I32ONnxCrk/4Y6ROZyKtKCS+MPwLphNZX7URwJGffJIhAN5hyXqV7S87?= =?us-ascii?Q?l8vxNCYj5q4e/Dyqy7iepis1yGs8jRNQ1zCtHpPmJZQs0alvgMGs8xgVYKt4?= =?us-ascii?Q?DyYnDPpq8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v?= =?us-ascii?Q?nC+PzYr25/BnJBtCfJ0Kuu1V0zk3x0BhIhr3/4q3LyO4Nla1WKRQHT9ce5Jk?= =?us-ascii?Q?7T/PtEs1HEIH3m6Noz2XbhuthFOgV6u8UQPXnUlnGfMzKrhOoihTbTJSV1a1?= =?us-ascii?Q?9Brp0nhYqRn+jGgTftA=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4252.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1bb1d22-ed58-45e9-ca24-08db632f459b X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Jun 2023 06:04:48.5229 (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: ifQQEijRKuuLSx/M4trV3fuYCndaElvyIgUvqDEN0baljiYEC9ype8DDvhHOShodx19XiH4BhmJwZn0IzrI+/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR11MB8328 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi, > -----Original Message----- > From: Stephen Hemminger > Sent: Thursday, June 1, 2023 11:01 PM > To: dev@dpdk.org > Cc: Stephen Hemminger ; Xu, Rosen > ; Zhang, Tianfei > Subject: [PATCH 04/25] raw/ifpga: replace snprintf with strlcpy >=20 > Suggested by devtools/cocci/strlcpy-with-header.cocci >=20 > Signed-off-by: Stephen Hemminger > --- > drivers/raw/ifpga/afu_pmd_core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/raw/ifpga/afu_pmd_core.c > b/drivers/raw/ifpga/afu_pmd_core.c > index 3ab1f47ac1a4..e969897dbe7d 100644 > --- a/drivers/raw/ifpga/afu_pmd_core.c > +++ b/drivers/raw/ifpga/afu_pmd_core.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include >=20 > #include "afu_pmd_core.h" >=20 > @@ -225,7 +226,7 @@ static int afu_shared_data_alloc(const char *name, > return -EINVAL; >=20 > /* name format is afu_?|??:??.? which is unique */ > - snprintf(mz_name, sizeof(mz_name), "%s", name); > + strlcpy(mz_name, name, sizeof(mz_name)); >=20 > mz =3D rte_memzone_lookup(mz_name); > if (!mz) { > -- > 2.39.2 Reviewed-by: Rosen Xu