From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 8FE4D231E for ; Tue, 22 May 2018 21:42:45 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2010520E5F; Tue, 22 May 2018 15:42:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 22 May 2018 15:42:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=0GVIb/MvWVZGT5XH0Rs0T8TInR aCyPcxHhVjxNOX14M=; b=eL6w6T6ZK6s+ZsLLeY+EYIzGpXSps1TqN/yEO6XGJH udflRIi9klKsUdCMMkiUYp4klnvbjutIHf8uaCkkwowq5m468att0vIqWXqgZfLd tbn8DwpMDeoIKK+oHfN9G9wziQapbqhgie6YT9jCNvV5bMPrVLpv27tln2umdDGr 0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=0GVIb/ MvWVZGT5XH0Rs0T8TInRaCyPcxHhVjxNOX14M=; b=AT2mjAZcvd7xe5msR8giBZ FBfogfozRqiJYHN97dHtpNlhvZRGBvix7JrlwnVI13SF7enLKIr1VwW26zpKcGZE zaTIhd0eW6X3DBU6LV/Qs5oyi3pTBDWR62OQ0e62wrOxqqBaBilPuzB9sS1fMpeN j7P6DE2Zo2nnKsDV7tJP4LRCz6IiusuPiNkjNxKhEGx+UQ4PsIqcO5qSOvsJl1TH xm/QGYmizWp3mpzvTeLgOTKdM0myiXMrj3HiijDmR6KQeKm4cTc0yJsdW5Pt9giP zTHZIFt93Q8P6BzzHcgU2Nf19eu8smhHtMIBRckJZYw6pAANeVzirV2C0HIvTuLg == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 7F323E4115; Tue, 22 May 2018 15:42:44 -0400 (EDT) From: Thomas Monjalon To: "Liu, Changpeng" Cc: "dev@dpdk.org" Date: Tue, 22 May 2018 20:18:03 +0200 Message-ID: <9373529.Cr5sn6mvdD@xps> In-Reply-To: References: <1526599932-13083-1-git-send-email-changpeng.liu@intel.com> <3339436.bIZ7ygsVkQ@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 2/2] examples/vhost_scsi: fix potential buffer overrun with safe copy API 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: Tue, 22 May 2018 19:42:45 -0000 22/05/2018 19:58, Liu, Changpeng: > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > 18/05/2018 01:32, Changpeng Liu: > > > - strlcpy((char *)vpage->params, bdev->name, > > > - sizeof(vpage->params)); > > > + vhost_strcpy_pad((char *)vpage->params, bdev->name, > > > + sizeof(vpage->params), ' '); > > > > Why do you think vhost_strcpy_pad is safer than strlcpy? > > A code Coverity issue 279452 reported for strlcpy, so here replace with internal API can avoid it. I think it is a false positive. Remember that Coverity is just a tool.