From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 70A06AABC for ; Tue, 8 May 2018 16:31:07 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 May 2018 07:31:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,378,1520924400"; d="scan'208";a="37746644" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga007.fm.intel.com with ESMTP; 08 May 2018 07:31:05 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX103.ger.corp.intel.com (163.33.3.157) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 8 May 2018 15:29:16 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.150]) by irsmsx112.ger.corp.intel.com ([169.254.1.237]) with mapi id 14.03.0319.002; Tue, 8 May 2018 15:29:15 +0100 From: "Dumitrescu, Cristian" To: "Zhang, Roy Fan" , "dev@dpdk.org" CC: "Singh, Jasvinder" Thread-Topic: [PATCH v2] examples/ip_pipeline: fix buffer not null terminated. Thread-Index: AQHT1jH2s/i/BW2+0E2z5nLKcLxzoaQmBXXA Date: Tue, 8 May 2018 14:29:15 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D891267BB667CE@IRSMSX108.ger.corp.intel.com> References: <20180417094546.80472-1-roy.fan.zhang@intel.com> In-Reply-To: <20180417094546.80472-1-roy.fan.zhang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] examples/ip_pipeline: fix buffer not null terminated. 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: , X-List-Received-Date: Tue, 08 May 2018 14:31:07 -0000 > -----Original Message----- > From: Zhang, Roy Fan > Sent: Tuesday, April 17, 2018 10:46 AM > To: dev@dpdk.org > Cc: Dumitrescu, Cristian ; Singh, Jasvinde= r > > Subject: [PATCH v2] examples/ip_pipeline: fix buffer not null terminated. >=20 > Coverity issue: 272563 > Fixes: 8245472c58c8 ("examples/ip_pipeline: add sw queue object") >=20 > Signed-off-by: Fan Zhang > --- > v2: > - using more generic strlcpy approach >=20 > examples/ip_pipeline/swq.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/examples/ip_pipeline/swq.c b/examples/ip_pipeline/swq.c > index c11bbf27e..7e54a1dbf 100644 > --- a/examples/ip_pipeline/swq.c > +++ b/examples/ip_pipeline/swq.c > @@ -5,6 +5,8 @@ > #include > #include >=20 > +#include > + > #include "swq.h" >=20 > static struct swq_list swq_list; > @@ -64,7 +66,7 @@ swq_create(const char *name, struct swq_params > *params) > } >=20 > /* Node fill in */ > - strncpy(swq->name, name, sizeof(swq->name)); > + strlcpy(swq->name, name, sizeof(swq->name)); > swq->r =3D r; >=20 > /* Node add to list */ > -- > 2.13.6 Acked-by: Cristian.Dumitrescu Applied to next-pipeline tree, thanks!