From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.warmcat.com (mail.warmcat.com [163.172.24.82]) by dpdk.org (Postfix) with ESMTP id 7D3B01CBBF; Sat, 12 May 2018 03:24:32 +0200 (CEST) To: "De Lara Guarch, Pablo" , "dev@dpdk.org" Cc: "stable@dpdk.org" References: <152600304856.53146.9681482138854493833.stgit@localhost.localdomain> <152600317613.53146.6276891139126316271.stgit@localhost.localdomain> From: Andy Green Message-ID: <9413cb82-dec1-94bc-0ce8-5ba2f46adf0e@warmcat.com> Date: Sat, 12 May 2018 09:24:26 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Sat, 12 May 2018 01:24:32 -0000 On 05/11/2018 06:55 PM, De Lara Guarch, Pablo wrote: > > >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Andy Green >> Sent: Friday, May 11, 2018 2:46 AM >> To: dev@dpdk.org >> Subject: [dpdk-dev] [PATCH v4 12/18] net/sfc: solve strncpy size and NUL >> >> 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 say this patch could be squashed with the previous one, as they are solving the same issue > in the same file. > It also needs an extra fixes line (so the final patch would have two fixes lines) and CC stable too. OK it's adapted accordingly. -Andy > Fixes: 7b9891769f4b ("net/sfc: support extended statistics") > Cc: stable@dpdk.org >