Received: by 10.223.164.221 with SMTP id h29csp3179527wrb; Fri, 3 Nov 2017 03:05:32 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QmZYPi/XJSTmasqNHaG3j5EIyaDQSo3KvPoIrHEk9+cGY8s2R49T8xVdk6vc3oWvOIzf5h X-Received: by 10.99.51.6 with SMTP id z6mr6578200pgz.276.1509703532146; Fri, 03 Nov 2017 03:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509703532; cv=none; d=google.com; s=arc-20160816; b=quiY3Wxp1zQm35rUOT2b7GGO+MxBRpDBGYHCABmqGC8EwR6I11eJshjwkEqHG6c7ML 0XRMjmV70aTCxHMyhoNdMsZfqQilZiI29a/Vu/ZHxT14NR1Ht8vLbJosOaT69ParPFsS eM2nOa0C6rIst/ovJMAo+5dmBXEmWi62rRKCcjQeAagCuoyIuSoi9ONMGQOvScY1FyD9 C7K4bfQlXuL1LcCIY3D1NvDPgDOHbdVaN9YqPycp41ijqAcwn5XmrW9tJ5IIdIJCa/tn Xz7A7/DgvFf+sNjkbX8GttF5w4Qt/lViJZRdHB8ex+JZIyK0TPpxfIaGfbP8GIjeS1lZ oCSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=8aQOxU6W9R7ujTdtJQBfLk70PfviqoPpIXiQJQpRoXw=; b=SCD9Alxdy7TF+3am7gnBi6m0kUVUjUXWHC0+q5Ge++EpD7I+zZCqmw0Hr4PPt22j22 31i4F+T36x+Mn2/weNGlV6cWszTqcmChuw88F+dCMtaGFDaj0rvb2f/Gnp0wYNkAqXmb COsv9BS7JBbhmim1UmT6TRA67vTpMaxoPNrqruE1pDw/GKjFcRxB8UPdZC05omy6A2AX l6IrTXqyGqlcbyAkKLCpX3G0A6Jn0DFWqy9dy78jSJ2pTC+9+1UOIY8W+vAgapMMH+8X vPyy/NhpPxV2d3u7UlSZdVNLnMKzphY5xLSoA5tcah7zWlFRFdDLuvOFCcCISyUtNQet GkPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=XY4W3Vw+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg2si4900152plb.606.2017.11.03.03.05.18; Fri, 03 Nov 2017 03:05:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=XY4W3Vw+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932201AbdKCKDk (ORCPT + 97 others); Fri, 3 Nov 2017 06:03:40 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:54186 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755919AbdKCKDA (ORCPT ); Fri, 3 Nov 2017 06:03:00 -0400 Received: by mail-wm0-f65.google.com with SMTP id r196so355966wmf.2 for ; Fri, 03 Nov 2017 03:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8aQOxU6W9R7ujTdtJQBfLk70PfviqoPpIXiQJQpRoXw=; b=XY4W3Vw+YzmoKgQsCcs31aF03ikc4xr2fW3jQUJbJ9utNwPDpfylswzYNBPMIYN0/q oHnioBV4L2QZqG4123rF4QZNa5C1Nlj2WygF7i6NazlmF7eliKw5vV3skrAQrMuCddNg FmoFJ5zthxvj/e2zwtDboyqQEZu2FuFpehB1A1b74he8tkvqjXEV7CAqwRDvoMNS44zG FM1NuLmy6f1qNauNh6AMgiR1IAG4BR/6WU9jfBl80xYP9FDEB/m6lXxH/ZSZ+8B5JlIL O3C5UkDSrgKUODP3+pJtXwS7d26Tx++B4+akWdMdUck6Qf+UzIha7wSZ9JNwX6lw6uqR bBOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8aQOxU6W9R7ujTdtJQBfLk70PfviqoPpIXiQJQpRoXw=; b=TWwMFkwRmySzy7PKzgVNzlGrwL+yJDdx0PrC/hgx+6rzTbbaF5PIVedB2bkmV10H08 oF718uURX0v8uITZfTQIQVqZU44+DWgQ8yjGAi/sLoQoPvr73hypXAfG/SlS/dwXOpAf rMQQ+4YBYVLjcljGQLkM/6NxwCPWIEry2VbZtw2xRCxK5kzJVXC2Pry5VLeBk3ynQ91c g0HpuGXxKptlOiSFA+Hp0R9J+kkbw/U5KXNEYB5egdx5G4RBlWEYFqZn1RlihQuBt91Y uPb5dNdbd4IC28CLdM0uSL4NmDuMA34wnauLl4xfErR0RivTn0PC+2Q/uYDvKawBhit+ lS/A== X-Gm-Message-State: AMCzsaXUY9JzeMdZfZCmgBGvhG2am8scXvbBpB7E8vrBrSL32hs6QCYi 1KSKVr8j3L4K4VEQd38RL/00iSec X-Received: by 10.80.183.193 with SMTP id i1mr7948183ede.167.1509703378917; Fri, 03 Nov 2017 03:02:58 -0700 (PDT) Received: from uHalley.cnexlabs.com (6164211-cl69.boa.fiberby.dk. [193.106.164.211]) by smtp.gmail.com with ESMTPSA id 41sm4837530edz.66.2017.11.03.03.02.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Nov 2017 03:02:58 -0700 (PDT) From: "=?UTF-8?q?Javier=20Gonz=C3=A1lez?=" X-Google-Original-From: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= To: hch@lst.de, sagi@grimberg.me, keith.busch@intel.com Cc: linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Javier=20Gonz=C3=A1lez?= Subject: [PATCH 2/3] nvme: compare NQN string with right size Date: Fri, 3 Nov 2017 11:02:49 +0100 Message-Id: <1509703370-20379-3-git-send-email-javier@cnexlabs.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509703370-20379-1-git-send-email-javier@cnexlabs.com> References: <1509703370-20379-1-git-send-email-javier@cnexlabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Compare subnqns using NVMF_NQN_SIZE as it is < 256 Signed-off-by: Javier González --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index bd1d5ff911c9..ae8ab0a1ef0d 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1743,7 +1743,7 @@ static void nvme_init_subnqn(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) nqnlen = strnlen(id->subnqn, NVMF_NQN_SIZE); if (nqnlen > 0 && nqnlen < NVMF_NQN_SIZE) { - strcpy(ctrl->subnqn, id->subnqn); + strncpy(ctrl->subnqn, id->subnqn, NVMF_NQN_SIZE); return; } -- 2.7.4 From 1583045876433541439@xxx Fri Nov 03 11:56:34 +0000 2017 X-GM-THRID: 1580953760860038708 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread