git: f021e3573519 - main - bsnmpwalk: Fix crash on invalid data
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 10 Jan 2025 20:47:55 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=f021e3573519ff192fc708cda9ca4bba264c96f7
commit f021e3573519ff192fc708cda9ca4bba264c96f7
Author: Shteryana Shopova <syrinx@FreeBSD.org>
AuthorDate: 2025-01-10 20:30:21 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-01-10 20:47:06 +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
---
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;
}