From nobody Fri Jan 10 20:47:55 2025 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 4YVDHv6K06z5kXBm; Fri, 10 Jan 2025 20:47:55 +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 4YVDHv512nz4Yx0; Fri, 10 Jan 2025 20:47:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736542075; 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=6tqYUJjfS0VoY04pw9/C2GHEJ6oUisJVzLNEH1I+RX0=; b=g5+q6d9XISdYgzqWEQqhYUXHrgeOhXUTYiHxlZBnhqQ4W8KXv6hECrPfhCKR4q2xIIVqjX 0J+EEsgkKAshLlBr3JUriSb/VxO0OqtfACbgDaeTkndhrpeNO8EUuKEW/0QLGZml7tvBLk xJ0zlt4Kk65G455CISpzfSWBmCUxAO093k+6FGd8vqOgU6HeBmaIHvt2+FyHBu9W4kQ5sf Ab3wJcvhxu3+IqQ14MHiwqzipGz9CX+SN0RRbdpcxtKFdQmNJKRfG0QkKQLMd+VCVvXw+1 ZWiN3a+AvDMe8aDs177n+GL3OZRDzSd5myc9ZmmPkCmz9W2h75RsteoxoYYKGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736542075; 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=6tqYUJjfS0VoY04pw9/C2GHEJ6oUisJVzLNEH1I+RX0=; b=skhZYiU3C5sFYsoTMovwFRCOuzIj+7hQmcC6W8dLV3+fZ729CjUaKk2lCVcXx596w6pLEC JqgYiuCFgDMOlqoywZRoGK0YtUuRddW+o7tAaOtb9M9uLWmddQMny0VSYYV8t1k6lWaTZ3 Lf7bQg7mO+N27mDniuS4TLPPgfoS51tbUclVAjvFcBie9/LuNigcdxrNTr5HW0taYhaCaA AplNmhiSZk7ZfEy5o1VPEnu+AaQOSO4fYtmFCgiievOoPH8ue4AULJx8zRQLUDIvaRRqpp rBzwlMAYMKfFOSFw30gBvAJube4DzjwDFq062ZWXjsfuX8cKA5H+YjsAPW8plw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736542075; a=rsa-sha256; cv=none; b=oP4g4DodhHTForLFo8jUsuciPobcZTe/iRJQxbEX89DyUUM1TjtcolZdVYS8xiw3CX6fV9 wYxgEyx2UzwA5mnQhs//eOg1gUtiKZg3KhiGXDc4pq0a4O13TVmMZp8RnOYUpBaUN1QLzw 5yXSRzNKguqfjiVHjgVrrrWQu0px3QbNLeanAzv/42g0gfIe8W8KQ+6Hiqqfh8C5hHzMSX EVeAEblYGwYgzy0TeHAU+BZhcssHrhZHvQZEt9u5/P+LXZSyu8OOXQ/OQR1XM5QHY/VbBe fdlLnBoqaXYN3bj29qtxC0gi1v25WcggEwWTAP+3DqIEo93YZAukfGbjdGp6yA== 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 4YVDHv4cNQzCTh; Fri, 10 Jan 2025 20:47:55 +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 50AKltvt093291; Fri, 10 Jan 2025 20:47:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50AKlt7k093288; Fri, 10 Jan 2025 20:47:55 GMT (envelope-from git) Date: Fri, 10 Jan 2025 20:47:55 GMT Message-Id: <202501102047.50AKlt7k093288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: f021e3573519 - main - bsnmpwalk: Fix crash on invalid data 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: f021e3573519ff192fc708cda9ca4bba264c96f7 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f021e3573519ff192fc708cda9ca4bba264c96f7 commit f021e3573519ff192fc708cda9ca4bba264c96f7 Author: Shteryana Shopova AuthorDate: 2025-01-10 20:30:21 +0000 Commit: Ed Maste CommitDate: 2025-01-10 20:47:06 +0000 bsnmpwalk: Fix crash on invalid data PR: 258570 Reported by: Robert Morris Reviewed by: emaste, markj Differential Revision: https://reviews.freebsd.org/D48422 --- 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; }