From nobody Fri Dec 22 15:50:13 2023 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 4SxWw60VJSz547Lw; Fri, 22 Dec 2023 15:50:14 +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 4SxWw569x0z3R5H; Fri, 22 Dec 2023 15:50:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703260213; 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=Kmu8rcNngpE6TWlA4NDZbkJH8wDjF/sR7WjjEkuX4Qk=; b=j1m1dsjVMypFb5ShlgYkZ9VEcXcwoVKO9RQbekj7odb9Jai6vSltWcaa4M20mXeMAXpl+J rsfi1Y7OQvGAqH1mV1OUZlS2SQ37KSM4QSJy/xoA/re66dFmnrE/m39cEwyQfwFYkIOai4 yP4r3uWfBbE77UrUb8hM9VEIALhokCz1MkscZfcs9c/SWWDN8lpUv4g/+XCG6a9ArcaBtD kSV+a5Pw8TUfwhf7Sc5FEtzof4t2xZnoNA4QF+BOZ9HHchgdMhrYVKeJeQuKlMMukbUv69 jkfdnrRgwrsAEL1xinlhuBfdb0sjhyilFQ7LSoOxdQn1qrAHoVSx+E70WW7dCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703260213; a=rsa-sha256; cv=none; b=cso79Wxx0maENs5XQdgI0cP4keXZ4fe+gjH8ayLDv39djJ3RT0ojnoyB/fNhEWR67Egvww 3eEXGFSJd1M/uXvQ8e4VIy/fdglUQqlJCerlMm8g3rqmPKx0V+BqbIPlMRYfQ0J2aYRDSb O3P8R/jBky2JZ0GZIj4vPRcykvI/kes5ImpvEXA+w5k0Q01p65JOm+f9Lai/F4DA7nvyr+ NnFwoiIFVD2ZtN+zK7ypVLB+9KXRvpaGXn+cZcSCNcdtiPHnnX2Ga8TswSCn4Ou25mIvZe IYH7kmV+1iiIVYpAXg2mgnhZ9L4yEkCuBxHpw8lZfy2KssJ7VoAZa+EtXUPccw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703260213; 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=Kmu8rcNngpE6TWlA4NDZbkJH8wDjF/sR7WjjEkuX4Qk=; b=daL3lnIZBWxNho9uDfSVCeeKnNnMfKSt9mQzbOuW3ttm610DWtMdXZAmIW6q4eS8LXV9EV 7Ebx9QUQkO1BKMI0+pGvnEC7wjU7dRuCr77yw81vpM8ulRtzDZQpnffyB/OBAtNp0ol4Vs HFZIL2mrqMEfmZpPJhwdeNKibaTr47FBPXmfaKKqClO3fRIn6e0xgFbJTegDhYEyZrCIch lmc8OIKXMnRy98I3ziPYGBl/QJbLmBIIkhU6mpoB+2V8Y5x5I9/fdJ68CWl3f4u+YIwJAl B0GD7Zg0minl02VEzhhgC1aqPOjWUv63snw1OzESKt3zl7TZugSS9Vt1bTobDQ== 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 4SxWw55J4xz7LD; Fri, 22 Dec 2023 15:50:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BMFoD6m000625; Fri, 22 Dec 2023 15:50:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BMFoDTe000614; Fri, 22 Dec 2023 15:50:13 GMT (envelope-from git) Date: Fri, 22 Dec 2023 15:50:13 GMT Message-Id: <202312221550.3BMFoDTe000614@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: d281fece432f - main - kldxref: Appease a Coverity warning 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d281fece432f97b4424b852f23dfe1f974b9e30d Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d281fece432f97b4424b852f23dfe1f974b9e30d commit d281fece432f97b4424b852f23dfe1f974b9e30d Author: John Baldwin AuthorDate: 2023-12-22 15:49:40 +0000 Commit: John Baldwin CommitDate: 2023-12-22 15:49:40 +0000 kldxref: Appease a Coverity warning While parsing .dynamic, nsym is set when parsing the symbol table from .dynsym. That parsing also sets ef->ef_symtab to a non-NULL value. The value of nsym isn't validated until after a check for ef->ef_symtab being NULL, so nsym always has a valid value when it is read. However, that chain of events is a bit much for static analysis to follow, so initialize nsym to 0 before parsing sections to quiet the warning. Reported by: Coverity Scan CID: 1532339 Sponsored by: DARPA --- usr.sbin/kldxref/ef.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c index 46d3dc1f4578..fd0782ff1dd0 100644 --- a/usr.sbin/kldxref/ef.c +++ b/usr.sbin/kldxref/ef.c @@ -361,6 +361,7 @@ ef_parse_dynamic(elf_file_t ef, const GElf_Phdr *phdyn) goto out; } + nsym = 0; for (i = 0; i < nshdr; i++) { switch (shdr[i].sh_type) { case SHT_HASH: