Date: Sun, 12 Jan 2025 19:31:58 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: 7fbbab2d326b - stable/14 - bsnmpwalk: Fix crash on invalid data Message-ID: <202501121931.50CJVwUm047167@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7fbbab2d326bcbfa1592c6104b745cd5973f5aaa commit 7fbbab2d326bcbfa1592c6104b745cd5973f5aaa 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:31:44 +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) --- 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?202501121931.50CJVwUm047167>