From nobody Tue May 23 01:20:02 2023 X-Original-To: dev-commits-src-all@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 4QQGhM2ZWgz4CjMN; Tue, 23 May 2023 01:20:03 +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 4QQGhM0fF8z3L6j; Tue, 23 May 2023 01:20:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684804803; 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=llplxu9XNvTckR7bui4adrrDvhDcm+GzXGwgVr4T2UE=; b=XAuesmLzvqxMoj5dT/JbC4NJDTLXJ79CyE6OR6L+cNDiAz90bWXCjYU4i6H+Io9QQql/Bx YAuZmZ+PAoXDCPxLnfX5iJcpDR2pRhbbYJ1EdfyREHor02ZQzX1k+ddpP/lIx89fUCTRh8 0OzglAc8lEhxDt7ltVH0sJ5EerZpalwJk9btzPFF4F9rsHNQw0o6QdTfQ1DUHq30CsvMDM q0NLUdj0nas0OCTuA5ZH4NRb46XAtGoJJGhcXHIC3MPTHRP7LsFJmYrrcV6Z1rSQTrH/+g NvWTelTUvZqDuHMKHfNpqZmYnN/Tj14osgOsyWx3mE/k184Zf0/XFEoCQ/dC/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684804803; 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=llplxu9XNvTckR7bui4adrrDvhDcm+GzXGwgVr4T2UE=; b=k8ZAaFTvOGK7qUBnQv0kjEkLUqmlXgMfBVpoVjCUj9B0gwbW9UyI5o5U6M5tA/wPfGjBjo PX/P9mtnAOnnwP4ZcrdBSB9z3wICbAp1zUwUCXLq0NEYm4Fph71tE67fpP4riMi5ZlszXQ xrhXqB5yUd2ON4+xN0YK+pEOY1DWBlkG3ynHNPL/Ln7uICVEzfslf5MMi7MxHxqVUS0Uf9 +x9ZWvgCAdwo2Pbucr3A5AMgse6Gc4zMJ04G3OXss/7iHWlY/EgGqdtQt44ITgym7rUql/ vUyfQQU92B9YU6R27SyzOmBq7ZA5WG4uxEkxx2VcrlXXuox5hlUCTCLgAd1mcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684804803; a=rsa-sha256; cv=none; b=h9WVJ8KAeRnfjnR5a39vexElEHIQm8YC2b8KsFKCq5KsueWx9mFAkOQ8niJXaI4JyOJEGY 9n4iVr7nxLGMiu696IVbQnPoxXSAIC4OjeAeBvhVhNgXJyiVdFxk902STX3vfOTStQyH/n vrscOhp+Y/YzVMmZAUOo5U8yzJdLZG7+gZqewhN5eCXD5lZErc37UVE2qIueVlrlI0Lzzl 6dxPb0h7bJE6BfYRdDQPaBJLX3rtpYjW+N3Ieqc5BUSd17lNlzbHfR7qTBsH8/1PGoE4Og Hy0jdSikeE4M3/GCxsRJ+S7N58vQ/Z04UfqRcfG5yq/pTT6h4XUxtQkevK+Yow== 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 4QQGhL6pgjzg4J; Tue, 23 May 2023 01:20:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 34N1K2nm016493; Tue, 23 May 2023 01:20:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 34N1K2iF016490; Tue, 23 May 2023 01:20:02 GMT (envelope-from git) Date: Tue, 23 May 2023 01:20:02 GMT Message-Id: <202305230120.34N1K2iF016490@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: 5a9c724847f9 - main - Correct size parameter to strncmp List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a9c724847f9b4e3831aa2c16276cc2ae20a99cc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=5a9c724847f9b4e3831aa2c16276cc2ae20a99cc commit 5a9c724847f9b4e3831aa2c16276cc2ae20a99cc Author: Rose <83477269+AtariDreams@users.noreply.github.com> AuthorDate: 2023-05-08 23:08:18 +0000 Commit: Enji Cooper CommitDate: 2023-05-23 01:16:29 +0000 Correct size parameter to strncmp The wrong value passed to strncmp meant that only enable and disable were being accepted. This change corrects the logic so enabled and disabled are also accepted. Pull Request: https://github.com/freebsd/freebsd-src/pull/739 MFC after: 1 week Reviewed by: delphij, ngie --- usr.sbin/mptutil/mpt_volume.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/mptutil/mpt_volume.c b/usr.sbin/mptutil/mpt_volume.c index 9c160542f51c..04f69bcdf929 100644 --- a/usr.sbin/mptutil/mpt_volume.c +++ b/usr.sbin/mptutil/mpt_volume.c @@ -246,9 +246,9 @@ volume_cache(int ac, char **av) Settings = volume->VolumeSettings.Settings; NewSettings = Settings; - if (strncmp(av[2], "enable", sizeof("enable")) == 0) + if (strncmp(av[2], "enable", strlen("enable")) == 0) NewSettings |= 0x01; - if (strncmp(av[2], "disable", sizeof("disable")) == 0) + else if (strncmp(av[2], "disable", strlen("disable")) == 0) NewSettings &= ~0x01; if (NewSettings == Settings) {