From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atomicrules-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Xz9vj1is2v5rC+++0Ajwfm9e0ZwsKOy7GIO5KKftqcA=; b=tA42jcQfAgNWT39+geBmzbkaNBPkGzPlcOkLQ96NHZ3r1robuY7uM7OVtQ7GVa8VGQ zLkNW6//zeHKMflNsY/Iht3f6IqtsH6BWGr9vXnWjPufqCYi5gxzuKNh7BaDH5tAOQZI qWmIDcNaDfIUKfCsGYS7QXvem/hHSrnrX/H6lF19lr+N0Vs5Tbq4SINC040GdjbTFI93 rzoWFww4CZirZAmVds3Y3lOGuFMpWWvbjlledBrmwUCA1iTvjK3jtSI95VFUa4nf8Zpf MVJbZxp2rL9NCgGGzi5QPoeZb8MhQ4wDJtXWuW5q8IodpwFTTqp8uV44yK1Hj3znJjCq hEmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Xz9vj1is2v5rC+++0Ajwfm9e0ZwsKOy7GIO5KKftqcA=; b=Dp1gwV32TJ7X/7qi6JYaLthXgso0rCM719YY/55HtS7gM48QqEN84KpMZndMhvKyOM TQ7j3JhoY6r1+z/5mmI2tVwUq1RYjU5ORoXj1k/Ugu0AjCl11G8oqA/XmiU4oHH9gDe7 Z5qJZKsj0/e9ygXP0CHnGU/ZMw7GbpKy/M+rpsreVoPYyRd2jydCzWXtWPC6FZeHXHfu y9tItgGaTuR+dkpkj3AoGeugjFU9GAxtIjCcChM7Xean7ZdLGCQjRuAk92x0OyxdJonr T+Om6qyMsCUo90XW6j6FAA5LGMUMKKHeAK8sRBiUKeXWIY4PHs3bhXNMXN4hUh8ObVLy Wxtg== X-Gm-Message-State: AODbwcDLehdAU8fueYkCcgx34CagVAX0NVvkZ9mRMuYNgVsz3qwNG/cM qb6dn1EaTwl6sg== X-Received: by 10.55.18.91 with SMTP id c88mr8342489qkh.143.1494674916539; Sat, 13 May 2017 04:28:36 -0700 (PDT) Received: from [192.168.0.11] (h69-21-89-58.cntcnh.dsl.dynamic.tds.net. [69.21.89.58]) by smtp.gmail.com with ESMTPSA id k86sm4418325qkh.12.2017.05.13.04.28.35 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 May 2017 04:28:35 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) From: john miller In-Reply-To: Date: Sat, 13 May 2017 07:28:34 -0400 Cc: dev@dpdk.org, Shepard Siegel , ed.czeck@atomicrules.com Content-Transfer-Encoding: quoted-printable Message-Id: References: <1494500548-12411-1-git-send-email-john.miller@atomicrules.com> To: Ferruh Yigit X-Mailer: Apple Mail (2.2104) 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: Sat, 13 May 2017 11:28:37 -0000 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