From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F2E69A0524; Thu, 30 Jan 2020 19:55:36 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2328F1C02D; Thu, 30 Jan 2020 19:55:36 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2052.outbound.protection.outlook.com [40.107.21.52]) by dpdk.org (Postfix) with ESMTP id B334A1C01F for ; Thu, 30 Jan 2020 19:55:34 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bO7FoZubMgJnrVMXH2zj0KJVlK9pctZAXb37vw3MGzcavma1wUvK07kknyGsql/P2PDZMjhopCu2vWXv/ANBmgVo4PbkbLzkezMCorkRs7u6c8E1rHUt1Cr3V5TuIfqOCHSXipjlDxpe1nqnUmSH7ODbS5PEvZwY5UdufJqfMeuctBOw259GbCugrTsN/cKC0OBPqvFe46Guq49z29kI3Fhry1obj+8WSWfd3QQ1PaGKBRarXMtk7E7Y7jJ3o5DDhM1mGUnBUbAhYQX7qZc6tq5f8w2VW8f7GFQeltyttQlPMmxyiytU1xuViYBj0p1KOnMSgSeGLXMsAfFGufi8AQ== 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-SenderADCheck; bh=RwnVeOj4dyS3SGTTMYRVlYg11PDZoZgavnVpnliSeD4=; b=jXwOmGa1ln+ohflEth0un9yiSa7eJFfMeCzmfkHZY1LU2YJ6gPMe4Y3kpzxcXomRskyxy2uSTsaeNn02F2iZmisB/l+cMcd5OkFrk4r4PKAG/VbzYBNfNJu/sYpvdtwG5U1aTtlmBmWzcQyNu/ac5I9VrYDcMtN+UtBdZ828258X1JANGOpARgmzISrUR50eIKhEASF7RAAdJRwF/H43wVM9Rs6y3vJup2A4qIx8KMm7wnzoNduuC+8qafjO/2Dn2jIhxbQDF8EC9mXs6hq7qJcnuEKT9oyigsyr/rAoOeNuykNTe6yzaLfUKCHOj73QfLqvAb1B4LjI9kSOuUN28w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RwnVeOj4dyS3SGTTMYRVlYg11PDZoZgavnVpnliSeD4=; b=AGM/MsDIvWwoJmXVqfFzgVJ1HwIzVhTj4985ZS5Bfg4fLeVMbdj0Rc07TLfncfPv8ZeCG281fKrsgTSezM7DkP4ZXWdh30k50LIUv3v9tZkUqVpaNhzTkoJ1Fjkt8Vl9V8eD0yKp8X52mFP/ZQqyMAEVNE5CbG754Z9kPvgDJi0= Received: from AM6PR05MB5176.eurprd05.prod.outlook.com (20.177.196.158) by AM6PR05MB6120.eurprd05.prod.outlook.com (20.179.1.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.22; Thu, 30 Jan 2020 18:55:33 +0000 Received: from AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::1888:dbf5:a84e:c53b]) by AM6PR05MB5176.eurprd05.prod.outlook.com ([fe80::1888:dbf5:a84e:c53b%6]) with mapi id 15.20.2665.027; Thu, 30 Jan 2020 18:55:33 +0000 From: Ori Kam To: "Iremonger, Bernard" , "Lu, Wenzhuo" , "Wu, Jingjing" CC: "dev@dpdk.org" , "Yigit, Ferruh" , Slava Ovsiienko Thread-Topic: [PATCH] app/testpmd: fix copying the name of the dynflag Thread-Index: AQHV13BkGGtVvFp710yr96VJQvlP46gDbOmAgAAhYbA= Date: Thu, 30 Jan 2020 18:55:33 +0000 Message-ID: References: <1580390564-186435-1-git-send-email-orika@mellanox.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-originating-ip: [185.175.35.255] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 3ec239ed-8fec-45e9-e950-08d7a5b5fbfe x-ms-traffictypediagnostic: AM6PR05MB6120:|AM6PR05MB6120: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1824; x-forefront-prvs: 02981BE340 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(39860400002)(366004)(136003)(346002)(376002)(199004)(189003)(316002)(7696005)(110136005)(53546011)(54906003)(26005)(6506007)(186003)(8676002)(478600001)(86362001)(81166006)(81156014)(8936002)(2906002)(4326008)(52536014)(5660300002)(9686003)(55016002)(107886003)(33656002)(66446008)(66476007)(64756008)(66556008)(66946007)(76116006)(71200400001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB6120; H:AM6PR05MB5176.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jG3jsjDfyy3v+aK+Czi9IsR55Cz2YLDLHubWYXgamBScQtt+8AV+yZQ/r9Rmt/YRo62Gq+cK1aAhQfOZ6K6Gk62WyjlgEM2xcJvuP9oBeCRQFTwtfEMAgfqxhRVptHd8ZwEHDkpdTtgj34wPVL6NYBgaewI0TD9yFKPxLMyMa+azb9Y8fY9tnIBCnkS2eCBeM7+bGKHfxchpUiUJlDqsMaubH6uHMlwAimjoo/YoCW8qtgmtj/yH95hlyoDjOQ3SCQuNt8hcv8Ud1UER3yncQUm9nDRiZ0v4uut5TXqjqk7/ZoO4gAzkOeF7hCU7g531KZ18up8322/mguTHjZyZBabZXgUfmXIOpkZn6wThpZQdUxIaDzH/5ST616ZDp2qXjLagHAw9PbnUKOBfPLjKxswLhkNr2WOCfKTplZ97MK8fUE3agin0zrk81uqFqDgL x-ms-exchange-antispam-messagedata: oyAq4WYdZ80OEmsA95OWOTWYzo9XfnbVAmHn6p6Or99okNeaZA73bhvKu7ypmX+UWvddw4ybqEkwmBuoM8SfpVfYNVzIeDOvLVpt94SjQC7J19atov7pHxpXl72RQrh2JNylmOEvrVgyz4DkIXrQcQ== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ec239ed-8fec-45e9-e950-08d7a5b5fbfe X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2020 18:55:33.1245 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ijtyz8Vd68XQFUX+qO0UjeLCBqIIpelj1fpXR82pRjz4YjcKR5ONaAUo8H59gjGMdM9onTMUHSJx0tnzZ+p1OQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB6120 Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix copying the name of the dynflag X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Bernard, Thanks for review, PSB Ori > -----Original Message----- > From: Iremonger, Bernard > Sent: Thursday, January 30, 2020 6:54 PM > To: Ori Kam ; Lu, Wenzhuo ; > Wu, Jingjing > Cc: dev@dpdk.org; Yigit, Ferruh ; Slava Ovsiienko > > Subject: RE: [PATCH] app/testpmd: fix copying the name of the dynflag >=20 > Hi Ori, >=20 > > -----Original Message----- > > From: Ori Kam > > Sent: Thursday, January 30, 2020 1:23 PM > > To: Lu, Wenzhuo ; Wu, Jingjing > > ; Iremonger, Bernard > > > > Cc: dev@dpdk.org; orika@mellanox.com; Yigit, Ferruh > > ; viacheslavo@mellanox.com > > Subject: [PATCH] app/testpmd: fix copying the name of the dynflag > > > > When working with testpmd and setting the dynflag name, we copy the > > name given by the cmd to the dynflag name. > > > > The issue is that the size of the dynflag name is smaller then the stri= ng used > > by testpmd. > > > > This commit solves this issue by usign strncpy. > > > > Coverity issue: 353610 > > > > Fixes: b57b66a97ebf ("app/testpmd: support mbuf dynamic flag") > > > > Signed-off-by: Ori Kam > > --- > > app/test-pmd/cmdline.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > > dab22bc..09429f9 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -18867,7 +18867,7 @@ struct cmd_config_tx_dynf_specific_result { > > return; > > flag =3D rte_mbuf_dynflag_lookup(res->name, NULL); > > if (flag <=3D 0) { > > - strcpy(desc_flag.name, res->name); > > + strncpy(desc_flag.name, res->name, > > sizeof(*desc_flag.name)); >=20 > This does not look correct to me. > Should it be sizeof(desc_flag.name[RTE_MBUF_DYN_NAMESIZE])); > You are correct, I will send a new version. =20 > > desc_flag.flags =3D 0; > > flag =3D rte_mbuf_dynflag_register(&desc_flag); > > if (flag < 0) { > > -- > > 1.8.3.1 >=20 > Regards, >=20 > Bernard.