From nobody Thu Oct 27 00:24:45 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 4MyRJZ0kXMz4gW54; Thu, 27 Oct 2022 00:24:46 +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 4MyRJY60fQz4QTY; Thu, 27 Oct 2022 00:24:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666830285; 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=E+X8Ey+paMGSdAE6T9b3y/r5wBq2Cf5t+xwoJDC33a8=; b=D6nBKiu0QGScUvrnzSrnvOP4ws8y4/2O5Z9bdXIXPqZYeqo1Jm1Fc/DYZ2m2RkJMZhANVv zD4Qqc+7j8weGyh7vIF/uJw8t5jQqmP5GXa0HEjwF/4SKGPniTzmPina7lhxgpRa1I1/9o r4rPFcMPol17QB8GXcCr0eMGQ5XqiKSMEB7cCruKjw5f4RDsghDqtlnPKDQDWFDN4cnlI9 UWMwZ9ZKt3bOOczNUY2P7E7lRjW5HIcPs3NBMOIxYJqNmJZHA7biD3bFcNevwQ8TI92f9M dnrTrHGGc3iSWNROdKG223zkSn2LZzdLldoHn67EjT6GzpWBg6nKYxty0X4G6g== 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 4MyRJY54VQzd6R; Thu, 27 Oct 2022 00:24:45 +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 29R0OjXO033754; Thu, 27 Oct 2022 00:24:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29R0Ojqg033753; Thu, 27 Oct 2022 00:24:45 GMT (envelope-from git) Date: Thu, 27 Oct 2022 00:24:45 GMT Message-Id: <202210270024.29R0Ojqg033753@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: 889dcb5e9b2f - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 889dcb5e9b2ff4160c313b31cfa53106af2a5b0c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666830285; 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=E+X8Ey+paMGSdAE6T9b3y/r5wBq2Cf5t+xwoJDC33a8=; b=B8TcvV9jpM9Sv87ZRXTAHohQ2b0eOU2/6AbMIW/282Zv1yagI0BJXrEHLZRL3P1MchwPtU s5w8Pe5Ow9VwOK0GkbjhOjsqVnES7EHuB5lHbaKj0FYQjmpZE7mcSGCEmFdN6Qkurzup0x lwlFi44IqY9+6lFo6OiPqm8aktBXXbtpbWj+GbNLIuC+FaIF9ul/Pqlp5SD5AR/Xl1PQ1x 59pJkTu8m12X3nZ21UWhES3h5eCpWLUrRlrmnFRmOmyUWdapHefPysOJ/WkzBf1d4yDghW Xp2weQWcG+bKZNGWvjRbTHdyFHMRa/fyhQW7v4jeb4FgAj4sqJw+oCeFTlUXOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666830285; a=rsa-sha256; cv=none; b=Y6fLpmlp3CbCgQH5nXCeQn7FYNaWReFAN1hpfve2yt5EvVgF5Tv9JJOzybHsJHaMhcXJ45 QpC7BrRy1SO9Vl4dJFl50yAEaO3f2FRfOKDaMesgsIJHJS3AEPekUKHEnoaRMPvPLpZPPx /KNZlCbTgmTsnkUa1YfbqxmFGFMCvsdHaqXrxf5n3135YqZssyIEfJ4nfKZBOEw2DDl3N5 R3SWtSDD8QF9ym1gHZEZ3Ln1XnLznroK6HJ9DY+9qMVOD+uxKxmiRNZwDxFQ5q0m5PKKrO zXYb7cfnqKsB9Bgq4FaHpBY9NyDWYB1ZWMMWrV3PTOmfdmhw2YWXa89L1SixJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=889dcb5e9b2ff4160c313b31cfa53106af2a5b0c commit 889dcb5e9b2ff4160c313b31cfa53106af2a5b0c Author: Ed Maste AuthorDate: 2022-10-24 13:45:59 +0000 Commit: Ed Maste CommitDate: 2022-10-27 00:24:07 +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) --- 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); }