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 5C11E1B7BB; Tue, 24 Oct 2017 18:22:47 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D6A6720F62; Tue, 24 Oct 2017 12:22:44 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Tue, 24 Oct 2017 12:22:44 -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=NmF5yiCjAEWkNzrYtF9ES3zsbR xwtzLQrjiV5vllhgw=; b=dB2EDNbX5TDiUdsBjNLnRRfglceDvXTUlWZ2ZsXlHz OsrCz1tSlB/okZtrohsgxxRwjU3pfW4leiES3s9A2ajZp/wtU6R13Lxv6w9HkAuq ilgVIOZoeqzNaT643Q6qQXL4jhlxiShsm5bMFmGeoxBjSpzBHy5I2o4qc6ctUBij E= 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=fm1; bh=NmF5yi CjAEWkNzrYtF9ES3zsbRxwtzLQrjiV5vllhgw=; b=l+F880WTut8KhJTnwwuwXt eE7uAL6p/yee9kbFoBgfsih+/K9+EawajHAzCG4UYrJBVRtUQ0G2CQh8uOS9EJNM 53g2Gl4r9B43+BI4hsOpctnORh0PHJDhidRmWMuwVp33gzG1T6aDn4XLCierCyKG p/UJeIvmWlBf5DkiiaM/GasXi5F22wgfLVq6PpIcgPS5JMSLPCS3ZRdJ9aIehBIp kAED5S6FN8oIyJVMNlD4iTvdK3zNPUCks5c68V+1POW/xUdtT77zcCfP/Wymk/3i ryvM2SEtpxBdb+sdJCRVBKsrgDeL7rZUGYPd0me1BIVzbH+fNJzQ/tZjqMh6FVmA == 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 893C37F94E; Tue, 24 Oct 2017 12:22:44 -0400 (EDT) From: Thomas Monjalon To: Yuanhan Liu , Maxime Coquelin , Jacek Piasecki Cc: stable@dpdk.org, dev@dpdk.org, michalx.k.jastrzebski@intel.com, changpeng.liu@intel.com Date: Tue, 24 Oct 2017 18:22:43 +0200 Message-ID: <3010275.oDysHLUK20@xps> In-Reply-To: <20171017132637.GY1545@yliu-home> References: <1507790695-10449-1-git-send-email-jacekx.piasecki@intel.com> <218441fc-8064-b05f-4eeb-4121dcdf849f@redhat.com> <20171017132637.GY1545@yliu-home> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3] examples/vhost_scsi: fix buffer not terminated 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, 24 Oct 2017 16:22:47 -0000 17/10/2017 15:26, Yuanhan Liu: > On Fri, Oct 13, 2017 at 09:12:33AM +0200, Maxime Coquelin wrote: > > On 10/12/2017 01:34 PM, Jacek Piasecki wrote: > > >--- a/examples/vhost_scsi/scsi.c > > >+++ b/examples/vhost_scsi/scsi.c > > >@@ -307,7 +307,9 @@ vhost_bdev_scsi_inquiry_command(struct vhost_block_dev *bdev, > > > strncpy((char *)inqdata->t10_vendor_id, "INTEL", 8); > > > /* PRODUCT IDENTIFICATION */ > > >- strncpy((char *)inqdata->product_id, bdev->product_name, 16); > > >+ snprintf((char *)inqdata->product_id, > > >+ ARRAY_SIZE(inqdata->product_id), "%s", > > >+ bdev->product_name); > > > /* PRODUCT REVISION LEVEL */ > > > strncpy((char *)inqdata->product_rev, "0001", 4); > > > > Acked-by: Maxime Coquelin > > Firstly, sorry for being so late response. And, > > Applied to dpdk-next-virtio. Thanks! I don't know where this ARRAY_SIZE comes from. It does not compile. In DPDK you can use RTE_DIM. This patch is removed from the next-virtio pull queue.