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 98247A0524; Thu, 30 Jan 2020 17:54:17 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 380191C031; Thu, 30 Jan 2020 17:54:17 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id DA54E1C030 for ; Thu, 30 Jan 2020 17:54:15 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2020 08:54:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,382,1574150400"; d="scan'208";a="319458420" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by fmsmga001.fm.intel.com with ESMTP; 30 Jan 2020 08:54:14 -0800 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 30 Jan 2020 08:54:14 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.171) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 30 Jan 2020 08:54:14 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m1Mlpz9fuB1Jffjnoq8wlME/vGp1wS0QBqWX2wlbgunXoYJcT4t97WX7TfSxP4Xx/phh+5izyDfrRV0CdiFAICXOGlHtnFoKCoPdxCPIBwN83VNsZoyOJA3EqajrLKEkKgbNmdsBtOK5HucoUTDO9Gaj7gyc4ZrUNipnnOVHd9376KlK0VzzrjwlgNnVa4ZH9d+93+N2nFpPY6S6rabKjmov9iCgM3y7R1ggH4z2HWoR9wEKNiAeHM5v008CuaC29tTuzEsJXYNRuKD4FitLm7GkBjLVDqOJTenw4yi/72l2P03kiyvcWoFxJH9Nb4VRTHQAJOBxlWMQQ3jVPmUpxw== 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=zCerj3BAt4vFcU0A576nPYoUBAbnAtzQqUSxsz5K9Uc=; b=iNwpK4rBdJAFqLCp7Inr9lOFntm/tosPJBD/BqEt4TyEFdcmLDtPU4xIEjOfd6EqYvfNtHhhadGcXnw5qme7+jsTObir0vyZ4wcHn95hH037Ku2PcoAZtt4dmj6IQLeEm6YylQtn+0xTH2p6iXiFKvIuHQz9FHCRfWeCLbE+4PFDIbU592eKQj8a8VFutvx+WV4JY0EDXL9TDorHLiepA4QS0mwoaDBYqkM0OE7BPWh7+egDxIl08+XU7rqwjVy3ennKOcuLk0swZzxcK3/JgZtZmhpk6X+3bhA4uE1FyYT5bR6dg6v0PXS3FXtPSh6dywVw2jR70k+vNHrF1gH44w== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zCerj3BAt4vFcU0A576nPYoUBAbnAtzQqUSxsz5K9Uc=; b=F4lZ3a+/zb42NpnooxIpNxtTnHRcs9lVQ4X3dXmKTbNayw10mrfrgI4ArbQJ3Fs9TdjZXTSY3yJaF9WgHUm5BI91vV1VxZzP6VnUGfVGJKAnagvLf8vgHO3uAG/vFhdYSvyZro0OWSrxlJcLHsFTqFiMLB93SelFCInErR4rQU8= Received: from DM6PR11MB3914.namprd11.prod.outlook.com (20.176.126.24) by DM6PR11MB3305.namprd11.prod.outlook.com (20.176.121.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.26; Thu, 30 Jan 2020 16:54:11 +0000 Received: from DM6PR11MB3914.namprd11.prod.outlook.com ([fe80::29bf:9a8f:7bba:dd26]) by DM6PR11MB3914.namprd11.prod.outlook.com ([fe80::29bf:9a8f:7bba:dd26%6]) with mapi id 15.20.2665.027; Thu, 30 Jan 2020 16:54:11 +0000 From: "Iremonger, Bernard" To: Ori Kam , "Lu, Wenzhuo" , "Wu, Jingjing" CC: "dev@dpdk.org" , "Yigit, Ferruh" , "viacheslavo@mellanox.com" Thread-Topic: [PATCH] app/testpmd: fix copying the name of the dynflag Thread-Index: AQHV13CUhtvIpttlCkyDABg3R9XC+6gDa9Og Date: Thu, 30 Jan 2020 16:54:11 +0000 Message-ID: References: <1580390564-186435-1-git-send-email-orika@mellanox.com> In-Reply-To: <1580390564-186435-1-git-send-email-orika@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTM2ODRiNTgtYTE1Ni00NDFiLWIwNTYtZGZmYTRlOTk3ZTQzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMW80XC9qZjl1OEpwNkZYOFJoMTBDajZiOVY4OHpMXC9RTDk5VWdaNTNFNlpiKzk3enR3QkVWTkdDVDBoSXNHMVVGIn0= dlp-product: dlpe-windows x-ctpclassification: CTP_NT dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=bernard.iremonger@intel.com; x-originating-ip: [86.45.36.39] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: aeb7d4cf-8a83-4da9-b7a3-08d7a5a507da x-ms-traffictypediagnostic: DM6PR11MB3305: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:312; x-forefront-prvs: 02981BE340 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(376002)(136003)(346002)(396003)(39860400002)(189003)(199004)(316002)(86362001)(110136005)(54906003)(52536014)(53546011)(186003)(5660300002)(71200400001)(26005)(9686003)(6506007)(4326008)(8936002)(6636002)(55016002)(33656002)(7696005)(64756008)(66556008)(478600001)(66476007)(76116006)(66446008)(66946007)(8676002)(81156014)(81166006)(2906002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR11MB3305; H:DM6PR11MB3914.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: I6P81t63jxSo7tujbMZVo2O1T5/C7ZnqjeGcN6YJw293awGmHZk464hxL8aI2cnZgS7yLUMevDoxcndW4uKqvw4C7qPjUr5UACj93pd9ZI+3ZMDtU91hrXfTyNCMQKqf+g/xLDyiIX/Fsl0WE+IVfqUD08ypdqsdYQEiLb+p3YMkK+6KJxxYhDrDcsM8reKi2+jqneo7bCw74WWBlCiydyvAAztfgNR84n8Ao9x/XDujrIUOWGJyqwEzdaVcW+XjN4URzhXCvxjSZciur8ZB5/NhBkdak1C+mW23MJNVzz3fnHqy0zwZJSYDzw/zEj9reEB+m91+CGYHpPEl/533r2usXll1sJ1VsRcgSxYABP+OZBHO8yWzIfQmAT5cv7xs1JoWCYJIHGHtd1HvfB2lYjto1Zc0NXMcbUl0Dg82Plaqwwfas51RjvRwMWtnEWkq x-ms-exchange-antispam-messagedata: w5pDRBhXTqayXPqH5YqybG6QvBOwiaBw9hMu4een8xNIr1HB3Fvw1+GpZgU8veq0NgU0+v/oXjhVGhoICczymxW7YP0nhxdX5nqDPSFmap6sonUSQIpN6IWcencImF5sweySn7OL7qJZirA9vcKc0w== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: aeb7d4cf-8a83-4da9-b7a3-08d7a5a507da X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2020 16:54:11.4226 (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: ZdoWAWPylmxJBuvV0s4Bfn21zOBYdu9p+eDPNHtxVCBlmXR3Y26QxB4b/po06tZbY9uGETAzqw0H/OlcORxN2LJnfe4b4574ksQcW7VYeA4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3305 X-OriginatorOrg: intel.com 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 Ori, > -----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 >=20 > When working with testpmd and setting the dynflag name, we copy the > name given by the cmd to the dynflag name. >=20 > The issue is that the size of the dynflag name is smaller then the string= used > by testpmd. >=20 > This commit solves this issue by usign strncpy. >=20 > Coverity issue: 353610 >=20 > Fixes: b57b66a97ebf ("app/testpmd: support mbuf dynamic flag") >=20 > Signed-off-by: Ori Kam > --- > app/test-pmd/cmdline.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > 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)); This does not look correct to me. Should it be sizeof(desc_flag.name[RTE_MBUF_DYN_NAMESIZE])); > desc_flag.flags =3D 0; > flag =3D rte_mbuf_dynflag_register(&desc_flag); > if (flag < 0) { > -- > 1.8.3.1 Regards, Bernard.