From nobody Mon May 13 19:04:19 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VdTS41Lqxz5KnWj; Mon, 13 May 2024 19:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdTS40m9Mz4cvP; Mon, 13 May 2024 19:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715627060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PaeMe9BnTs7AU3sS8yk/mgdLQ4RF4F9CFgKq1tFIYH0=; b=lYd4a5b74tvQev+BGr3ej+MLVbxoT5vF7rg4gRoI9vyAvpCZUaVICl2QzoLkCzk/3Zf2CV likywTODTWe1EtnzEOOvSnPLHQLbJi68HHnbN2fyW3G88Q+Oe2uD5Hp8ub7P6/g41yOogW eNk3Ah1Z/MkybOGqctPojQRB64crZLVwQVFz1gmECaqY+A3sKCE3AnGu0hiNcF1ZdX6dGA 3Y7E/mhyoj5I8A8Xq3OCI5YRTmBzGPk9wWxvHlUkR0UOE1IKHAzhCjlI+vbJrb5q2zwHSd H9hWZ1kv+BvZWZFWO4wN/r0h2E0qdo1C/D6nEjy+/v6AeYJta0A5gEx5a3dZXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715627060; a=rsa-sha256; cv=none; b=eAWsPi3YcCkRMoG5zr4zCnYzRJxjZDe/mBZShEVL6v6UIfheKCjH5y8YUVQDdBWHTixru1 nyaB0fnUUfo/QWZxtErUQyj8OPKbmA4MNmdXjvHqhDCC3FeWMILUq68Gqc34ilZRYSeNsM GQxzlpuCJDAg7JXEb+Ixx2G3LWuYS16QGGwe9LfJPSu1SjOq45mQjpo/W1Af4agPFprSf6 IyLxk5JluERyQcehzM5lDlco8H+ec4UkTRpbZAqZ338OQ+/jhpOzJ63BmQwqS+Q13Y1b8L x9LJL/NSXqU4k//ovW4ifSVNhki4gFqYO847YE5TP9ihQZsShj0Uvxkb99VsXA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715627060; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PaeMe9BnTs7AU3sS8yk/mgdLQ4RF4F9CFgKq1tFIYH0=; b=JPYETBbwN1OIt7MoiUk4FG5f1A+0LTxeXHSnD28NCtFYCPrZygvQowJqFHBU0EbUieHkfa Q9daZMH3w3Ofu7NcUfqcd19RrcBc8VbjDIWrnhdDPGnHdqWHHijbCLox/SpaWXpZ0rBc0D l+aQM1nghnekLZ4m93T8e0DvAJX+i9un6eXBlcbJ5Z06N+HFxx4r8bxdyj+Fw5VmQpZ//+ BfczUCUB7wMg73lCnVr5djKdDA2QO2OT+VxMuOLu8SlEV3ap48096F+b/p6k6s9HpYJmZ/ xIJXZIXoSNfW62BQaOpjWpQ0EfJcu5i5eh8KC+tT92r2AE0KdKqX8SdkoF2rNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VdTS40DyYz10pF; Mon, 13 May 2024 19:04:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44DJ4JAe001261; Mon, 13 May 2024 19:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44DJ4Jre001258; Mon, 13 May 2024 19:04:19 GMT (envelope-from git) Date: Mon, 13 May 2024 19:04:19 GMT Message-Id: <202405131904.44DJ4Jre001258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 01fc488381e9 - main - nvme: Use strlcpy instead of strncpy to ensure termination List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 01fc488381e97c0bf589a297caa0c4b8e6b3e1c4 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=01fc488381e97c0bf589a297caa0c4b8e6b3e1c4 commit 01fc488381e97c0bf589a297caa0c4b8e6b3e1c4 Author: John Baldwin AuthorDate: 2024-05-13 19:03:49 +0000 Commit: John Baldwin CommitDate: 2024-05-13 19:03:49 +0000 nvme: Use strlcpy instead of strncpy to ensure termination Reviewed by: dab, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D45152 --- sys/dev/nvme/nvme_sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c index f561756f99b7..2ba3df9ea6e8 100644 --- a/sys/dev/nvme/nvme_sim.c +++ b/sys/dev/nvme/nvme_sim.c @@ -203,7 +203,7 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) cpi->xport_specific.nvme.slot = pci_get_slot(dev); cpi->xport_specific.nvme.function = pci_get_function(dev); cpi->xport_specific.nvme.extra = 0; - strncpy(cpi->xport_specific.nvme.dev_name, device_get_nameunit(dev), + strlcpy(cpi->xport_specific.nvme.dev_name, device_get_nameunit(dev), sizeof(cpi->xport_specific.nvme.dev_name)); cpi->hba_vendor = pci_get_vendor(dev); cpi->hba_device = pci_get_device(dev);