From nobody Mon Dec 13 23:50:43 2021 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 D6BB418E5585; Mon, 13 Dec 2021 23:50:43 +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 4JCdYb3kPHz4cHg; Mon, 13 Dec 2021 23:50:43 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 614BD1DACE; Mon, 13 Dec 2021 23:50:43 +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 1BDNohhs040688; Mon, 13 Dec 2021 23:50:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BDNohEM040687; Mon, 13 Dec 2021 23:50:43 GMT (envelope-from git) Date: Mon, 13 Dec 2021 23:50:43 GMT Message-Id: <202112132350.1BDNohEM040687@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c983ec6428ec - main - libdwarf: Fix error handling in _dwarf_elf_init() 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c983ec6428ecfa362903cbdba1dc9f4303e2f28c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639439443; 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=QOugW5xWPqzfnyqv1mmPM7PKFamZKaqlUr1f3R+eXa0=; b=M1Gg3iisAevKLD1inNXD7y85wJKr/tkkxU3oe5Kaeg5cjf/M44aWgq5VZf0sCGhSURt0C2 qUXapbZF65b5fiOXu67/oYR2iNnUNcP/BQXx+mae4AnFf9FAlCBoNddUFnqCNldPQskkWt PP5nvhoP6dc0noyuh/9czhBYhV5It4K2VthDSs1QajOOG0wa1AHpTJi1dWwpMJi2cQYV/w d6ACdkmUQCMhBGZ13nMlMn5sJACClZ3kieq+GJXSn4HKjn+KZbgnlb5Z8aZdJyNW9KEuV1 MKtBh0wbat2A6aOCFjODcI/YDpFWfs2Dlw1cnoqkSWVTb+3pCK/Ajc2rxJV22w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639439443; a=rsa-sha256; cv=none; b=BPXDEEhPSid9h7qYwzSqIHzwk6jbs0P4rhAzdUlhsOH7kM5zK8OysmOLtdGx++XnKsDnkz sqQfngtks7tGNoNSXlNM2MbLYDSHSVgns1uTZHtRU9LIJa1OpGC5eXkae1bdfi8HpzSHKe SJ3wTFMGyz+CeEDCJ/lNx6igjb7ROqEG2yxgUo2968v83PxLZpsDWoN4P5wKsIVUxuwc6Z tiMrrD+NzAJJQxeoxJSr4vjcSiWWJzmalwxFobMzs1ackoblrk48bvu9ufAMeP+aw+4ad7 OWumVoa3OwUHyLm+NmI+RQ1xR1QrfejopXDGeQKuN88pddP6gpKhd7onwsH28A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c983ec6428ecfa362903cbdba1dc9f4303e2f28c commit c983ec6428ecfa362903cbdba1dc9f4303e2f28c Author: Mark Johnston AuthorDate: 2021-12-13 23:45:24 +0000 Commit: Mark Johnston CommitDate: 2021-12-13 23:46:59 +0000 libdwarf: Fix error handling in _dwarf_elf_init() We were not setting "ret" before jumping to the error path, so the function returned success even when it had failed. Reviewed by: emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33420 --- contrib/elftoolchain/libdwarf/libdwarf_elf_init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c b/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c index c9b6ae601e0e..68062ee3209f 100644 --- a/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c +++ b/contrib/elftoolchain/libdwarf/libdwarf_elf_init.c @@ -398,17 +398,17 @@ _dwarf_elf_init(Dwarf_Debug dbg, Elf *elf, Dwarf_Error *error) } if ((sh.sh_flags & SHF_COMPRESSED) != 0) { - if (_dwarf_elf_decompress(dbg, e, scn, ed, - es, error) != DW_DLE_NONE) + if ((ret = _dwarf_elf_decompress(dbg, e, scn, + ed, es, error)) != DW_DLE_NONE) goto fail_cleanup; } else { ed->ed_size = ed->ed_data->d_size; } if (_libdwarf.applyreloc) { - if (_dwarf_elf_relocate(dbg, elf, + if ((ret = _dwarf_elf_relocate(dbg, elf, &e->eo_data[j], elf_ndxscn(scn), symtab_ndx, - symtab_data, error) != DW_DLE_NONE) + symtab_data, error)) != DW_DLE_NONE) goto fail_cleanup; }