From nobody Wed Sep 11 14:45:01 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 4X3jz11rCKz5Tc6h; Wed, 11 Sep 2024 14:45:01 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X3jz11GyRz3xK8; Wed, 11 Sep 2024 14:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726065901; 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=f9ERT+XMOXuxUHk01pUaYMbFrUFC17ih5sU6rKpU7aA=; b=ILeIodC0RC+8KlaUJ1fmNqarkYbj28eZWcX04zHpsaqmTGH6KOkK5LuI+NDsyHp73Pqi9r 1lUCIIFHhh9XuySp8Vfm3jxd5XWu04xerb9sIMouNyOy537ukm1+2laG+PbFDq7AtWtwKg vDFYKKOfD+3jCZCaaC8pyfkGlvGEP6BPx7Plr1qJcQtBAzfvQDKM8XXODonTQv34b2IvVg oZ7+f3ssaBM2ws2EiJk4HkpQJ9fV/+ZjsnQW2HDi0y7IHOwE5LjUA6r4vqB1t1BpzQNgdw SK/f2YgjaS39eVewYXcAZOwr+aXHULBc6/9+54tOz4BmRl/ruz7zxw7ttmtVpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726065901; a=rsa-sha256; cv=none; b=vaOmfYXQM0/7OIRI8wB/xcu7DP35yik0RCi//IBUWVC8F1IQuraJZAhySBJxtl7ZcQ64ST j+DXv1rgcPOACFZIujdI2Ajis2rQjSSaAPPkDPsMAYpxRTNefLytxbNSl4Sw08ykhBwW+V 5JJAfLeZLuronNLDc8dMr+FE9zAR/qTajZm4veSiiDSBsaS62gKT4a0JCodFeTiM3LbiwY rPnS44mS+ddnbYWhg1425MJF8/0XYGZBFA/dn/2d+GuMXjaXnIaIqSYSrS1NhRrea0i2HY PXL62Io83/Bq3Gpdu1X3a1e5rMlvSjI0ZgYHirup3gfKW/6ksz6y4qu2VEqasg== 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=1726065901; 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=f9ERT+XMOXuxUHk01pUaYMbFrUFC17ih5sU6rKpU7aA=; b=HWvEMDzMr1v5OwcsIOdTWnkwhRbCDSMfQp/j5l5h4ygqTd0OA99hrZ0HRmwquAada0om1g 2bXwaTTKiFgowrkcZhSLhdLtK4hZcfOsRBPEl0aIYxpfXpjb4iwT+aN1SqED3sNfMXpA7e xNCnX2AoWSbQrK99yqb93C2+xh8cccf5HQ+keJP1+t/tIL98Dhce/ZZBU4vEh3NRHqYFPx hbOQElTMieH4rcQlsoY3/K2k90M7q4dr9MOxONavzYdhTwdLXDFnJSeYC9lAg4oVhwEBre p5YRABBzCjk1qRoeZu31k4mDoHtJQSxkBuAgcMVPZW61QKz5WS1lveNT87Tu/A== 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 4X3jz10tH0zbG8; Wed, 11 Sep 2024 14:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48BEj1th020705; Wed, 11 Sep 2024 14:45:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48BEj1Ai020703; Wed, 11 Sep 2024 14:45:01 GMT (envelope-from git) Date: Wed, 11 Sep 2024 14:45:01 GMT Message-Id: <202409111445.48BEj1Ai020703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: 7f4731ab67f1 - main - libnv: correct the calculation of the structure's size 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: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f4731ab67f1d3345aee6626eb83cc5ce00010f0 Auto-Submitted: auto-generated The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=7f4731ab67f1d3345aee6626eb83cc5ce00010f0 commit 7f4731ab67f1d3345aee6626eb83cc5ce00010f0 Author: Mariusz Zaborski AuthorDate: 2024-09-11 14:43:43 +0000 Commit: Mariusz Zaborski CommitDate: 2024-09-11 14:43:43 +0000 libnv: correct the calculation of the structure's size Reported by: Milosz Kaniewski --- sys/contrib/libnv/nvlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/libnv/nvlist.c b/sys/contrib/libnv/nvlist.c index 1dc0bb8c1141..00ba3b41f3a3 100644 --- a/sys/contrib/libnv/nvlist.c +++ b/sys/contrib/libnv/nvlist.c @@ -1022,7 +1022,7 @@ static bool nvlist_check_header(struct nvlist_header *nvlhdrp) { - if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(nvlhdrp)) { + if (nvlhdrp->nvlh_size > SIZE_MAX - sizeof(*nvlhdrp)) { ERRNO_SET(EINVAL); return (false); }