From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP; 12 May 2017 04:11:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,329,1491289200"; d="scan'208";a="86749567" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.81]) ([10.237.220.81]) by orsmga004.jf.intel.com with ESMTP; 12 May 2017 04:11:14 -0700 To: John Miller , dev@dpdk.org Cc: shepard.siegel@atomicrules.com, ed.czeck@atomicrules.com References: <1494500548-12411-1-git-send-email-john.miller@atomicrules.com> From: Ferruh Yigit Message-ID: Date: Fri, 12 May 2017 12:11:13 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <1494500548-12411-1-git-send-email-john.miller@atomicrules.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH] net/ark: fix for Coverity issues 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, 12 May 2017 11:11:17 -0000 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; >