]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r310729:
authorngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 13 Jan 2017 08:55:37 +0000 (08:55 +0000)
committerngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 13 Jan 2017 08:55:37 +0000 (08:55 +0000)
commit7b8e2f5a1b638e611975f63e7f1cc1413ed8f9c7
treeee55c222a1876363adfc6172a0097576bd4372cb
parenta8ba14582d7d2a21306744898f6677486afe7bfc
MFC r310729:

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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@312047 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
contrib/bsnmp/lib/snmp.c