From: john miller Subject: Re: [PATCH] net/ark: fix for Coverity issues Date: Sat, 13 May 2017 07:28:34 -0400 Message-ID: References: <1494500548-12411-1-git-send-email-john.miller@atomicrules.com> Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org, Shepard Siegel , ed.czeck@atomicrules.com To: Ferruh Yigit Return-path: Received: from mail-qk0-f193.google.com (mail-qk0-f193.google.com [209.85.220.193]) by dpdk.org (Postfix) with ESMTP id 34AB614EC for ; Sat, 13 May 2017 13:28:37 +0200 (CEST) Received: by mail-qk0-f193.google.com with SMTP id k74so11060843qke.2 for ; Sat, 13 May 2017 04:28:37 -0700 (PDT) In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Ferruh, Thank you for your review. I will create a new patchset for these fixes with all of the changes you = requested. -John > On May 12, 2017, at 7:11 AM, Ferruh Yigit = wrote: >=20 > 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 >>=20 >> Fixes: 727b3fe292bc ("net/ark: integrate PMD") >> Coverity issue: 144514 >>=20 >> Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules = pktchkr and pktgen") >> Coverity issue: 144512 >>=20 >> Fixes: 1131cbf0fb2b ("net/ark: stub PMD for Atomic Rules Arkville") >> Coverity issue: 144517 >=20 > The convention is Coverity line first, Fixes line later. >=20 >>=20 >> Fixes: 727b3fe292bc ("net/ark: integrate PMD") >> Coverity issue: 144520 >=20 > Hi John, >=20 > Thanks for fixing coverity issues. >=20 > Can you please split patch into a patchset with multiple patches, > grouped to same kind of fixes? >=20 > 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 ... >=20 > Thanks, > ferruh >=20 >> Signed-off-by: John Miller >=20 > <...> >=20 >> --- a/drivers/net/ark/ark_pktgen.c >> +++ b/drivers/net/ark/ark_pktgen.c >> @@ -354,7 +354,8 @@ struct OPTIONS { >> o->v.INT =3D 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] =3D 0; >=20 > This also works, but you can prefer to switch snprintf(), which > guaranties the null termination. >=20 >> break; >> } >> return 1; >>=20 >=20