Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Jan 2025 19:32:59 GMT
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 748e7bc1521c - stable/13 - bsnmpwalk: Fix crash on invalid data
Message-ID:  <202501121932.50CJWx0T050230@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=748e7bc1521c87d292e8762c59e415ac687f69a2

commit 748e7bc1521c87d292e8762c59e415ac687f69a2
Author:     Shteryana Shopova <syrinx@FreeBSD.org>
AuthorDate: 2025-01-10 20:30:21 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-01-12 19:32:38 +0000

    bsnmpwalk: Fix crash on invalid data
    
    PR:             258570
    Reported by:    Robert Morris <rtm@lcs.mit.edu>
    Reviewed by:    emaste, markj
    Differential Revision: https://reviews.freebsd.org/D48422
    
    (cherry picked from commit f021e3573519ff192fc708cda9ca4bba264c96f7)
    (cherry picked from commit 7fbbab2d326bcbfa1592c6104b745cd5973f5aaa)
---
 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;
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202501121932.50CJWx0T050230>