]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r311750,r311754,r311757:
authorngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 14 Jan 2017 00:36:48 +0000 (00:36 +0000)
committerngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 14 Jan 2017 00:36:48 +0000 (00:36 +0000)
commit93cc5f989028f069158ea8460a62e5c7051bac9f
tree9a4c7a840400f21364fb248aca332e4575713008
parent1ae5207732ac5b79b97de7ddfc0d7657ee0a6d9a
MFC r311750,r311754,r311757:

r311750:

Check result from smiGetFirstNode and smiGetNodeByOID

This avoids a segfault with malformed or unanticipated files,
like IPV6-TC.txt (a file containing just TEXTUAL-CONVENTIONS).

Found with: gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt

r311754:

Use calloc instead of malloc + memset(.., 0, ..)

r311757:

Similar to r311750, check for the result from smiGetModule to avoid a segfault
when dereferencing a NULL pointer later on.

Choose to just check for the NULL pointer in the next for-loop for now to fix
the issue with a minimal amount of code churn

sys/queue.h use here would make more sense than using a static table

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