From nobody Mon Oct 31 17:18:19 2022 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 4N1KcC5DKmz4gkRc; Mon, 31 Oct 2022 17:18:19 +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 4N1KcC3yZqz3hyj; Mon, 31 Oct 2022 17:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667236699; 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=6yN7GY9ILxp3TtXfWANqne0r4kIB06Oo/LSmutot+uk=; b=jQ3xXYIWUVpo53uzWWoQJ0K9VZtVYt/QoSSlSN66pZs3bgdRwsPux0I1cU+BkQhBP170Px SKdDVteIYU68tVKZ5bwUT0xwKMluocze6kh1byfeSvqllNu68d9qAxKp5jY486Zfx0Ho2h 5M0GafEqdFrliRn3NTaBZXwGLtT8PFajl5xKLDnOTNLl6QNLWWmHsAlAepBMpZJs5oTU4W Xu118Ww/g1GARwpQCm8vzcopEmR7mRKLy7bFhLUJ6lE5wgqmIzHnXUb7WA5jf/0pRilXle +Eb1D8YCJrWqfXa6eXMFS4upxex8VapnvzAhIxGelipWSXAsInNQx0bldyzlRQ== 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 4N1KcC1WCmzkdK; Mon, 31 Oct 2022 17:18:19 +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 29VHIJe2003965; Mon, 31 Oct 2022 17:18:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29VHIJMh003964; Mon, 31 Oct 2022 17:18:19 GMT (envelope-from git) Date: Mon, 31 Oct 2022 17:18:19 GMT Message-Id: <202210311718.29VHIJMh003964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 990aa6476eec - releng/12.4 - OpenBSM: fix free() in au_read_rec error case 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: emaste X-Git-Repository: src X-Git-Refname: refs/heads/releng/12.4 X-Git-Reftype: branch X-Git-Commit: 990aa6476eec17339c170ac12f75fc253e8ec4c8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667236699; 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=6yN7GY9ILxp3TtXfWANqne0r4kIB06Oo/LSmutot+uk=; b=GtL7q8dYcrH/ZqRwXe9xGza2GP+b4lZv+7YZ8dK7eL50lzGLIQoHqkakDQsX5ZHThMlqJz 5avVnLaFRHlZBP2jTK+EhucQv3UxIxXb9Yon57u4Bnj0lhNjoYs3pVViQc1Iw/BJy0TXmb YZb9ZTpZBsMvDT3qJ9faHmKA3oCLt2bnRuxPbMUmhnuMJ1/Jh/JmwDZTOLMrJlXxNadaB1 PqxC8J9qCeQd64/Zr3XVXvdTqk8edIKBxB8zUpjiAEEyX/zouBKax6AtIqVjJKIjbmIaHA LNZpmU92JJ02dFbPuAbXW0bQplIQ67lVwMw8uR2w4iRWwpzCy/P+PZpCocXxbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667236699; a=rsa-sha256; cv=none; b=pvisWBoeTxbB4iT+TPCfawz/CwS4LmhUvmixHZ4cfjb3z79CJrJefhgX/UeMCFc0SyKOLS NIAEZ0Hv7MU3UkBK5X/5DTLarr4FEUCNPGtvVasEiE9YOnQ4KgKrbgKc+FbBvofR5DKKSb kvBHH7M4EaYxoW7bUeSj3WnFOTcL4MTRUhCqLNT8ozR4cmVvsp6XU/l7aK5PbpJmuxb3w/ 1hoQ22IemgP9Ucma5devmm9CePhX/ZWnI8qFIRWAbsUdqQXBoFLSm9RcYFpzGn9bO0f16R C2WSD0x3DM3m/MDKKVkS4smaQgXA8UxF8uSq3crNLooRJT+zIuhGW1MzteV4ZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/12.4 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=990aa6476eec17339c170ac12f75fc253e8ec4c8 commit 990aa6476eec17339c170ac12f75fc253e8ec4c8 Author: Ed Maste AuthorDate: 2022-10-24 13:45:59 +0000 Commit: Ed Maste CommitDate: 2022-10-31 17:16:28 +0000 OpenBSM: fix free() in au_read_rec error case buf is a char ** and *buf is the allocated buffer. PR: 267050 Reported by: Robert Morris MFC after: 3 days Sponsored by: The FreeBSD Foundation (cherry picked from commit c61b3f7de9a0a39d2bc78e3e78d148c369e706a5) (cherry picked from commit 889dcb5e9b2ff4160c313b31cfa53106af2a5b0c) (cherry picked from commit 2b25564af6f9d1303fb92b8dfd3a36f5d7fc3c34) Approved by: re (gjb) --- contrib/openbsm/libbsm/bsm_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/openbsm/libbsm/bsm_io.c b/contrib/openbsm/libbsm/bsm_io.c index 43cf7e9990c1..4b89ccb8b59c 100644 --- a/contrib/openbsm/libbsm/bsm_io.c +++ b/contrib/openbsm/libbsm/bsm_io.c @@ -4597,7 +4597,7 @@ au_read_rec(FILE *fp, u_char **buf) if (fread(bptr, 1, ntohs(filenamelen), fp) < ntohs(filenamelen)) { - free(buf); + free(*buf); errno = EINVAL; return (-1); }