From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH] net/ark: fix for Coverity issues Date: Fri, 12 May 2017 12:11:13 +0100 Message-ID: References: <1494500548-12411-1-git-send-email-john.miller@atomicrules.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: shepard.siegel@atomicrules.com, ed.czeck@atomicrules.com To: John Miller , dev@dpdk.org Return-path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 06AB91C4A for ; Fri, 12 May 2017 13:11:16 +0200 (CEST) In-Reply-To: <1494500548-12411-1-git-send-email-john.miller@atomicrules.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 5/11/2017 12:02 PM, John Miller wrote: > Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules pktchkr and pktgen") > Coverity issue: 144513 > > Fixes: 727b3fe292bc ("net/ark: integrate PMD") > Coverity issue: 144514 > > Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules pktchkr and pktgen") > Coverity issue: 144512 > > Fixes: 1131cbf0fb2b ("net/ark: stub PMD for Atomic Rules Arkville") > Coverity issue: 144517 The convention is Coverity line first, Fixes line later. > > Fixes: 727b3fe292bc ("net/ark: integrate PMD") > Coverity issue: 144520 Hi John, Thanks for fixing coverity issues. Can you please split patch into a patchset with multiple patches, grouped to same kind of fixes? And instead of having "coverity fix" in patch title, can you please describe what is really fixed, like "fix not null terminated buffer" or "fix missing function return check" etc ... Thanks, ferruh > Signed-off-by: John Miller <...> > --- a/drivers/net/ark/ark_pktgen.c > +++ b/drivers/net/ark/ark_pktgen.c > @@ -354,7 +354,8 @@ struct OPTIONS { > o->v.INT = atoll(val); > break; > case OTSTRING: > - strncpy(o->v.STR, val, ARK_MAX_STR_LEN); > + strncpy(o->v.STR, val, ARK_MAX_STR_LEN - 1); > + o->v.STR[ARK_MAX_STR_LEN - 1] = 0; This also works, but you can prefer to switch snprintf(), which guaranties the null termination. > break; > } > return 1; >