From nobody Sun Jan 12 19:31:58 2025 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 4YWQWL3vhMz5l8rs; Sun, 12 Jan 2025 19:31:58 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YWQWL3PzSz4NRK; Sun, 12 Jan 2025 19:31:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736710318; 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=ipDnAYoQmDuuzlh7b4DFMmKlG6HurcMxyAtlyVhi3wU=; b=i9BvQq0AuSq03T0o8wVsIpD7ZN8v2Bx1b9cI3JPxnbc2XQqJLgxW24Jf6SZnapBBhwLcGY 9Rb8rOcY4K2hWSOTBz9Dt8sORaxHCRagmwH5i5/9dgfxaokFO4yYSyJKNn52BErYN6YUkT ten+h3+5q/j+6awxIkbFevriK1wL3jMojVwiwEwidxqFAkBNiUTpD1YtTdckFU92Cl0Knl sMhnVaiY8SEpBaG2FwJ0+ZVM5RQwFvgfs8/hovEa0cXdbZTfwqPyMDo544R+2hBC5y2xSm vmRiR64AwaPfdLwLGPAjwZ1GDi+i4mH0c+s3LsA+Z89kQfBv+aOzINIWjfS2iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736710318; 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=ipDnAYoQmDuuzlh7b4DFMmKlG6HurcMxyAtlyVhi3wU=; b=PfYKgxPzaoBBIex7B7qCDAlFRURytE5CKZVaWdLVKSdEsoZrTpMnoXmXcn7LyYqVVaC+4d 9s+X1pnFSxeB/TiqbAcSoZuQ/tNL4MGjAWkCg973g5QH+eUJLg3DGx8mR4tSO+bi3gUDcl iWSxUbNax15rDxsmylVW1MNruimKqdjRsWApAUhE7404Lr2GGcmvwWXS4PB4D2HI+O8D3a LocpQH9zuOPh03Rn2YH0iNTxvOUjI00rl0jwXKy+tkehiAhzuOvCCP6eY5jy+uYMoACmUE GuOM//wHnVH8jBFb3BLn7lBR5L7xETkj5K6ErinmzxXbG0SFOsMp4UtSdd2cCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736710318; a=rsa-sha256; cv=none; b=WwFn257jJWs1SuwrX9nl638Rj4LJMgKSnoPolstF8Y2hae5jlUrOYEIfDCS8C6qprlf8Aa VQ7L4pWiG+7nYTAFVsMKlCiqBY0zHyefjUp0/WxZkJJp2uusL4xbsiziwxj7667/JSWMQB /8cX7d3Y8n4z9uMATRWK5n0A+3nuniOlFnFIiIs/9nLkTGugXSpisP7UyIj4lFyv12+0xZ /GslqtEkRdrqgGvFTAhdpn29ZkvPH5yNvkeUp+HB7arDk+NLaqugQGFKc974i2Ll/QxIJV p0r/JwM6YnvLfmhH4zX+FZgHV+E7w9EOUGrsNR7gLPvx3rtzDksSi8Rts/ifPw== 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 4YWQWL2z3Nzxhb; Sun, 12 Jan 2025 19:31:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50CJVw4Y047170; Sun, 12 Jan 2025 19:31:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50CJVwUm047167; Sun, 12 Jan 2025 19:31:58 GMT (envelope-from git) Date: Sun, 12 Jan 2025 19:31:58 GMT Message-Id: <202501121931.50CJVwUm047167@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 7fbbab2d326b - stable/14 - bsnmpwalk: Fix crash on invalid data 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7fbbab2d326bcbfa1592c6104b745cd5973f5aaa Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7fbbab2d326bcbfa1592c6104b745cd5973f5aaa commit 7fbbab2d326bcbfa1592c6104b745cd5973f5aaa Author: Shteryana Shopova AuthorDate: 2025-01-10 20:30:21 +0000 Commit: Ed Maste CommitDate: 2025-01-12 19:31:44 +0000 bsnmpwalk: Fix crash on invalid data PR: 258570 Reported by: Robert Morris Reviewed by: emaste, markj Differential Revision: https://reviews.freebsd.org/D48422 (cherry picked from commit f021e3573519ff192fc708cda9ca4bba264c96f7) --- usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c b/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c index 81108387d3a4..9d5a693c7c68 100644 --- a/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c +++ b/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c @@ -502,7 +502,7 @@ snmptool_walk(struct snmp_toolinfo *snmptoolctx) outputs += rc; - if ((u_int)rc < resp.nbindings) { + if ((u_int)rc < resp.nbindings || resp.nbindings == 0) { snmp_pdu_free(&resp); break; }