From nobody Mon Oct 03 23:11:29 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 4MhGmd6z5zz4V1Z6; Mon, 3 Oct 2022 23:11:29 +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 4MhGmd4L96z3Qm6; Mon, 3 Oct 2022 23:11:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664838689; 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=7qRZGMO7UNEcHWj/00BkUTGftOphPGnhf7yRa7gk8is=; b=Eb573ac+1UkXUOAfWmIf1geOYKAT780eNsuPzpNP7G+DLSztDWcyRLHYpvrkahB1mD+dVe yCQkAyBFJQvWp3dgU5c/C31FFbdXCYNWTTCZoc+TCOI3WopGmcijRxO/AKwTnD5EjodKCl ec1X/Uakg2a429jALrJesaIstNWC5DItGoIOd9Igx/4jwsaO03n5j39uJ5gjbS3vCR7c8+ 0V4Ra5L7YOfiTX3NiIqr8wj+ccJf232MQ93sOUm/m4XhI8I3kodX3vqSm0Wu19D8WLF2rK 0QhHziVXM5MRquZEUk+rUrr9ADc9VXrd1EdlPFkjZ6Dfj2ont8CPwOorYMNaAQ== 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 4MhGmd3RmxzMY2; Mon, 3 Oct 2022 23:11:29 +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 293NBTl6065781; Mon, 3 Oct 2022 23:11:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 293NBTSY065780; Mon, 3 Oct 2022 23:11:29 GMT (envelope-from git) Date: Mon, 3 Oct 2022 23:11:29 GMT Message-Id: <202210032311.293NBTSY065780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8f27c9d14a55 - main - libiconv VIQR: Fix a use after free. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f27c9d14a559f33aa7fc3245f841f7ce52fadd5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664838689; 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=7qRZGMO7UNEcHWj/00BkUTGftOphPGnhf7yRa7gk8is=; b=DhTLh/qPgr5f+Qe8AYVjQCSfi6ivOaldk7npCcSlUo9g3X5x4Mp4B8sCz1JErkDajitjSS bqUVvlKYeuoJZ8doOW4RW8U+vwBaRofoVncELyFjnIGDMIH2Jv8r2qXTs2E1fKNmsMOwva UmZZMqTODemWlCn3b0PQTfsU17CVTZeKP7yEJtJfWbbUq5ZRunc1a1TwfUtGY1cg3w1y7L lwjuHZP5/7nEDvWN0+9mIzx99il7/eI7Z2HotI+GE1bLOJ4Doqgfx5TbXML9+WfPCvNGeZ OAL7nFQhoLC4CplICgm75VzVYshZuz65WmzwMVpXeB8LwQdXAIPycN492Z8A8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664838689; a=rsa-sha256; cv=none; b=nz/V2r2v/5aP91MZsKO9pAGXn479N1zTvL5OVmV6g7cXd6R18glIb4ZVI7ubAKTyiZn0UO lVExgixDsqZDh5meAwU4+xfCV2wX24HyPBa0/Z3ziONPbIV5DJlVh48qoOqlNs2lMqSW96 DF1dYjKepePMhjMLYgClNM+1DsZn/6pS+HOxAK3TSDWxVKbAB4PDl9p0l8NAhxoqNx7qMG Fr5ONF1614J01h/4aqiEKehZpELL7qeZcv7c9nsHdob4V53ieYduBETbVG7B7gPER2vadU I0l7OGFfRK0ujeEdCXQXGwjuuP0wTmyQ8Q8x63rDuy3qi3cGz75MimEYQtIEUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8f27c9d14a559f33aa7fc3245f841f7ce52fadd5 commit 8f27c9d14a559f33aa7fc3245f841f7ce52fadd5 Author: John Baldwin AuthorDate: 2022-10-03 23:10:43 +0000 Commit: John Baldwin CommitDate: 2022-10-03 23:10:43 +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 --- 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); }