From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 9F4011CAE7; Mon, 14 May 2018 21:08:11 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id F1C0122133; Mon, 14 May 2018 15:08:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 14 May 2018 15:08:11 -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=/cJ6QVXX8MrGPTtuYb+5uKpJXT tkIsX4dzG/nITgBTQ=; b=EjfPl4jbe1XT374l2f+lZgY3ufdDK7GFS0edWeYdlh sak2X9VFYsld+eRrdeVCKCUHH+ilqdQGk+ly7HyseCnz3mvlEdE9g05NfFuPP1Hf vYiJB91SRlXpeSSSvkvipDKb0Bj+Q1VwBdEPfqUJTBCUImQ8i4OZKb3CRmj8CI12 g= 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=/cJ6QV XX8MrGPTtuYb+5uKpJXTtkIsX4dzG/nITgBTQ=; b=gaPfNFvScybWKSjY7k9nc4 nZjgVFk8QbolU19yl+ZDluOy2OV7Jl8Q+MhvVBc1bYDSmOjdTUNorG9LuoHMvG5v vAJQ50vL9WZqrD3bL7J01gsmai2k1M/6pVqist5bIsvHyD7YhtX4JsmZo6eD0oX1 8V/C4CmX7lKkTwvK236Inigb8bf/vUn8oXRjmS3QE9w3E53Lf+caijyqD7oxqcr3 62jX7vSPe+c3jr8QDiiv/bIszvOgrYCizEDWhmG5YDTeWpxkTE2/uBIitsQNiuY1 e0kK+8kHANbX8816CSlsW4xRyk4jGIFIEpiXdoKOhkykdGOH89xRpOWlIA0uJVeg == 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 C290BE5088; Mon, 14 May 2018 15:08:09 -0400 (EDT) From: Thomas Monjalon To: Michal Jastrzebski , Jacek Piasecki , reshma.pattan@intel.com Cc: dev@dpdk.org, yliu@fridaylinux.org, maxime.coquelin@redhat.com, deepak.k.jain@intel.com, changpeng.liu@intel.com, stable@dpdk.org, bruce.richardson@intel.com Date: Mon, 14 May 2018 21:08:08 +0200 Message-ID: <1932528.5N0iXfLR29@xps> In-Reply-To: <20170922130959.13484-1-michalx.k.jastrzebski@intel.com> References: <20170922130959.13484-1-michalx.k.jastrzebski@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] 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: Mon, 14 May 2018 19:08:11 -0000 22/09/2017 15:09, Michal Jastrzebski: > From: Jacek Piasecki > > Fix size of buffer in strcpy. There was possible to get > not terminated string after copy operation. > > Coverity issue: 158629 > Fixes: db75c7af19bb ("examples/vhost_scsi: introduce a new sample app") > Cc: changpeng.liu@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Jacek Piasecki > --- > - strncpy(bdev->name, bdev_name, sizeof(bdev->name)); > - strncpy(bdev->product_name, bdev_serial, sizeof(bdev->product_name)); > + strncpy(bdev->name, bdev_name, sizeof(bdev->name) - 1); > + strncpy(bdev->product_name, bdev_serial, > + sizeof(bdev->product_name) - 1); Can it be fixed with strlcpy? I wonder why recent patch from Reshma is not touching these lines: http://dpdk.org/commit/21ce8e44b8d