From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 8B45A1BC4D for ; Fri, 11 May 2018 10:13:35 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1-us3.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id F1797B40056; Fri, 11 May 2018 08:13:32 +0000 (UTC) Received: from [192.168.38.17] (84.52.114.114) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Fri, 11 May 2018 09:13:29 +0100 To: Andy Green , References: <152600304856.53146.9681482138854493833.stgit@localhost.localdomain> <152600317613.53146.6276891139126316271.stgit@localhost.localdomain> From: Andrew Rybchenko Message-ID: <686fa7e3-f8c6-29cf-eb65-9bd439494a61@solarflare.com> Date: Fri, 11 May 2018 11:13:25 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <152600317613.53146.6276891139126316271.stgit@localhost.localdomain> Content-Language: en-GB X-Originating-IP: [84.52.114.114] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.100.1062-23836.003 X-TM-AS-Result: No--5.473700-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-MDID: 1526026414-Kv5m6U7L9ItS Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v4 12/18] net/sfc: solve strncpy size and NUL 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: Fri, 11 May 2018 08:13:35 -0000 On 05/11/2018 04:46 AM, Andy Green wrote: > Signed-off-by: Andy Green > --- > drivers/net/sfc/sfc_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c > index ef5e9ecb2..a8c0f8e19 100644 > --- a/drivers/net/sfc/sfc_ethdev.c > +++ b/drivers/net/sfc/sfc_ethdev.c > @@ -664,7 +664,7 @@ sfc_xstats_get_names(struct rte_eth_dev *dev, > for (i = 0; i < EFX_MAC_NSTATS; ++i) { > if (EFX_MAC_STAT_SUPPORTED(port->mac_stats_mask, i)) { > if (xstats_names != NULL && nstats < xstats_count) > - strncpy(xstats_names[nstats].name, > + strlcpy(xstats_names[nstats].name, > efx_mac_stat_name(sa->nic, i), > sizeof(xstats_names[0].name)); > nstats++; > I'd suggest: net/sfc: make sure that copied stats name is NUL-terminated Acked-by: Andrew Rybchenko