From nobody Thu Jan 18 22:26:32 2024 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 4TGHQx1zWkz578fq; Thu, 18 Jan 2024 22:26:33 +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 4TGHQw6Ysbz42JN; Thu, 18 Jan 2024 22:26:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705616793; 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=hOsYc7w8LuI7KVQ9YndLAE1IRfoHdksEmsYiC/kYYSs=; b=TjVySYDjZTbdFgo9Fk24zB/pCbFVzPBpU+G7zm37Er4q0Q0UD3E0US6IH4/FDJ6y18/YNu S0qYAETou+eDe41vQk+66ZPHRcvXQLb54PQZEOy8TIXajzZba+cwWtDTVzhBJd1ddtkv0a 3TjPl+V7UaVyhqia8mkH6yL2Qwmoa9Ihki9M2rqc4efo0yAFGnfEHbiMABq/iaE4vsgKkM Ssbhgn36Ywfbsf+qHL0Iw4zR13KeJWDlMjHRWzl5DTrZPfsq6Z1CApiIEnDPI6yNC3HvrL 7i4sBPQDpfsAZnUvp0YuwlTrwgG9R6blFfRsgdiGOqLkPQxFAFKtW9V70wIgIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705616793; 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=hOsYc7w8LuI7KVQ9YndLAE1IRfoHdksEmsYiC/kYYSs=; b=q5wEN3A/GRFAmeP/Q/5QlSF2PGUTvQLGZRP1uOxaiV7pfckW3ce0QIzsHkDtoXcvD1fnZh YWERYWYRwI1AVDORuZASZPNp+SKH9LZ8Z6bDCa2DY0M3souX4A2WJCZerVuehSPhZ3v3a5 t55jxiPKt+KDUSDFKI4kE50RnNh908V5teROU6DFSmqnovq2z5l0teU3Uu2GufeCwZ1v9k QClBw4qMIAZCtpdxTZSBr7Ev0qbB+IDxizWu0obaYIlUXHFJ5losBMoGpvE+zdFb9LHW8s v56PiGj/WGFW4qsFqH0mF995m7cNmVgVI1JwAW1wGN8gXTKESeetNdAivN/doA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705616793; a=rsa-sha256; cv=none; b=l07j+5K7qvXVrzMoLh2wLyn6x3Z536+whJYDouT34jL2vch/eQR21eZaIbYd1TWfcKostn aFeIor9jaCU3+UxNCBS3b9gBTiHqvXu03zzMzL0/0oX4gHGkqoLJmI3saBVqgwFYhVs+En gyWvII3YzJvQ+EliU1oVCGHGSjn6LO+XqFAYkaKJSIZMDHllL0lndXO0nK2h3AukFXP1/w uLC0Onz/Xmec0mT/NQdbDMi8gyEJQqMRDeEM9R18ed5XHGDZJUAMV90M5xFmvPiNVRIA9j b0y8wU4dRUduN7NcsyV+0Q/F1Tvz2qtbeWT6T5cTHnoRaTaDRkxfRN1zjfLzuA== 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 4TGHQw5bTqzQZ0; Thu, 18 Jan 2024 22:26:32 +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 40IMQW8v090659; Thu, 18 Jan 2024 22:26:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40IMQWVC090656; Thu, 18 Jan 2024 22:26:32 GMT (envelope-from git) Date: Thu, 18 Jan 2024 22:26:32 GMT Message-Id: <202401182226.40IMQWVC090656@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: 319092aaacc6 - stable/13 - kldxref: Appease a Coverity warning 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 319092aaacc6cd642ffec049565bc5c7a4f3f3f3 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=319092aaacc6cd642ffec049565bc5c7a4f3f3f3 commit 319092aaacc6cd642ffec049565bc5c7a4f3f3f3 Author: John Baldwin AuthorDate: 2023-12-22 15:49:40 +0000 Commit: John Baldwin CommitDate: 2024-01-18 21:31:39 +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 (cherry picked from commit d281fece432f97b4424b852f23dfe1f974b9e30d) --- 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: