Skip to content

Commit

Permalink
bsnmpwalk: Fix crash on invalid data
Browse files Browse the repository at this point in the history
PR:		258570
Reported by:	Robert Morris <[email protected]>
Reviewed by:	emaste, markj
Differential Revision: https://reviews.freebsd.org/D48422

(cherry picked from commit f021e35)
(cherry picked from commit 7fbbab2)
  • Loading branch information
shteryana authored and emaste committed Jan 12, 2025
1 parent dfd9c9b commit 748e7bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 748e7bc

Please sign in to comment.