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
  • Loading branch information
shteryana authored and emaste committed Jan 10, 2025
1 parent 9234a50 commit f021e35
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 f021e35

Please sign in to comment.