HomeFreeBSD

Prevent improper memory accesses after calling snmp_pdu_free and snmp_value_free

Description

Prevent improper memory accesses after calling snmp_pdu_free and snmp_value_free

snmp_pdu_free: set pdu->nbindings to 0 to limit the damage that
could happen if a pdu was reused after calling the function, and
as both stack and heap allocation types are used in contrib/bsnmp
and usr.sbin/bsnmpd.

snmp_value_free: NULL out value->v.octetstring.octets after calling
free on it to prevent a double-free from occurring.

MFC after: 2 weeks

Details

Provenance
ngieAuthored on
Parents
rS310728: Install {asn1,bsnmpagent,bsnmpclient,bsnmplib}.3 as all of the APIs
Branches
Unknown
Tags
Unknown