From nobody Fri Nov 11 18:36:56 2022 X-Original-To: dev-commits-src-branches@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 4N86qs0b4Sz4dbRV; Fri, 11 Nov 2022 18:36:57 +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 4N86qr6LLlz3w6D; Fri, 11 Nov 2022 18:36:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668191816; 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=S0bqoSLde2325lnE5OHSihHDh7R96BZ9Vk6+8v+TXH0=; b=eXiT8rAM0gffRxQsQrGJyi7wxu5Hpoa6VhIEj9I9xw1nL+oubIQ7o6WppOLQCFruloOy9Q 46ZIdQ7vPBrD2lgUJDYk7nk6UpxfMmjF3PV68Qz3FEPFZ5E3jSTNUcqhtjc2DgX04izs2p QFJ7pMZlYcjYfhFl55g18wXZB0xUDx0AKZby1DNcubBymJwGPpTF+0KtkoiOrUCa6SSopX e44cQ/U6h3m0j9zO2zUczrZnrR/iBEmf5ARXivL1V7YSI+U6/TOkRq2uHYwRtSJbeNrcvr i0xHFSQQ6PxvbJ+ZQrl9otTel1iFLI4jMFeoQa5nWqxyhp9oAkaKhnW9FtqZLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668191816; 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=S0bqoSLde2325lnE5OHSihHDh7R96BZ9Vk6+8v+TXH0=; b=G20tsUmBoFlTR9eSeQ/CoBGTDYY5EyJFXU0+IewwLiX/mCur8np/MbIjF3pnGPhp/ilU/E lJeppa22Qd1Sk40LyzIxeYCVX/rI1kNiI+c9BBbX8U8yvRVj/Ff5cSc/rVM8tkMouihQF0 d4ih9E4JMfnD5F0qU+9rl/YPRgvD59kmua/iAXjab/IaC681OKHvtrDNt3WG3FbaVd8Ekl adbBGeVcP9MxpADqwpTjmrWd1dYjB9On9xSVjz1shAVgwblS1aXHpkUoe60txJY5nV4QB/ 466k0Q77OWGsSFDecYpl8eopNc31ipVQynXPxVCga3BdlbLJApBb0tMwasdxjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668191816; a=rsa-sha256; cv=none; b=j0C4CNO8zRb2p6oJIobHFqgKLIC2l+UMi+HMGWwor6UHFa63vcty1fx01aqy6jKjDCVEif fApejeW6/8phP0JGzF19WTB9QWEv16SmF9cp7rkwdnJKRn6QBd0YvqAVXMC5/DgkCRxfaa ekQCSIi870Td/d+wpUoGK85jKNb1l6yh64+JcXGs0s/ejI3e/8hMHHqEgL1RbForrYxxwt wMTD0hbzjBbJp2ubBSteRcwENuW4WL/7bq+pbeRrPFgfb3HG3/CmrrLf2CjhBk+3cyrPQV tc3BWX0n7EZ0lw2HIM9EpiDbDMmXJ9EFmrAa2Qc78WXQOk4WsNpCvBO0zqqlsQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4N86qr5RPmzt51; Fri, 11 Nov 2022 18:36:56 +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 2ABIaubc004262; Fri, 11 Nov 2022 18:36:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2ABIauQN004261; Fri, 11 Nov 2022 18:36:56 GMT (envelope-from git) Date: Fri, 11 Nov 2022 18:36:56 GMT Message-Id: <202211111836.2ABIauQN004261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 61abd47a09ad - stable/13 - libiconv VIQR: Fix a use after free. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 61abd47a09ade53566f54c6c5aa3abd70b9eb01e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=61abd47a09ade53566f54c6c5aa3abd70b9eb01e commit 61abd47a09ade53566f54c6c5aa3abd70b9eb01e Author: John Baldwin AuthorDate: 2022-10-03 23:10:43 +0000 Commit: John Baldwin CommitDate: 2022-11-11 18:18:54 +0000 libiconv VIQR: Fix a use after free. Use TAILQ_FOREACH_SAFE to walk to list of children mnemonics to free them instead of TAILQ_FOREACH. Reviewed by: emaste Reported by: GCC 12 -Wuse-after-free Differential Revision: https://reviews.freebsd.org/D36821 (cherry picked from commit 8f27c9d14a559f33aa7fc3245f841f7ce52fadd5) --- lib/libiconv_modules/VIQR/citrus_viqr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libiconv_modules/VIQR/citrus_viqr.c b/lib/libiconv_modules/VIQR/citrus_viqr.c index 8a81a7d12b01..f40910d8edf3 100644 --- a/lib/libiconv_modules/VIQR/citrus_viqr.c +++ b/lib/libiconv_modules/VIQR/citrus_viqr.c @@ -195,9 +195,9 @@ mnemonic_append_child(mnemonic_t *m, const char *s, static void mnemonic_destroy(mnemonic_t *m) { - mnemonic_t *m0; + mnemonic_t *m0, *n; - TAILQ_FOREACH(m0, &m->child, entry) + TAILQ_FOREACH_SAFE(m0, &m->child, entry, n) mnemonic_destroy(m0); free(m); }