svn commit: r513264 - head/net-mgmt/net-snmp/files
Kurt Jaeger
pi at FreeBSD.org
Sun Sep 29 19:41:49 UTC 2019
Author: pi
Date: Sun Sep 29 19:41:48 2019
New Revision: 513264
URL: https://svnweb.freebsd.org/changeset/ports/513264
Log:
net-mgmt/net-snmp: fix for first byte of IF-MIB::ifPhysAddress is always 0
- netsnmp_arch_interface_container_load() writes terminating NUL
directly to the sdl_data *past* the length specified in sdl_nlen,
overwriting first byte of physadrr.
PR: 231996
Submitted by: Yuri Pankov <yuripv at yuripv.net>
Reviewed by: Bart Van Assche <bvanassche at acm.org> (upstream maintainer)
Approved by: zi (maintainer)
Obtained from: https://sourceforge.net/p/net-snmp/code/merge-requests/20/
Added:
head/net-mgmt/net-snmp/files/patch-agent_mibgroup_if-mib_data__access_interface__sysctl.c (contents, props changed)
Added: head/net-mgmt/net-snmp/files/patch-agent_mibgroup_if-mib_data__access_interface__sysctl.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/net-mgmt/net-snmp/files/patch-agent_mibgroup_if-mib_data__access_interface__sysctl.c Sun Sep 29 19:41:48 2019 (r513264)
@@ -0,0 +1,24 @@
+--- agent/mibgroup/if-mib/data_access/interface_sysctl.c.orig 2018-07-16 16:33:40 UTC
++++ agent/mibgroup/if-mib/data_access/interface_sysctl.c
+@@ -531,8 +531,11 @@
+ }
+ }
+ adl = (struct sockaddr_dl *) a;
+- if_name = (char *) adl->sdl_data;
+- if_name[adl->sdl_nlen] = '\0';
++ if_name = malloc(adl->sdl_nlen + 1);
++ if (if_name) {
++ memcpy(if_name, adl->sdl_data, adl->sdl_nlen);
++ if_name[adl->sdl_nlen] = '\0';
++ }
+ }
+ if (!(ifp->ifm_addrs & RTA_IFP) || if_name == NULL) {
+ snmp_log(LOG_ERR, "ifm_index %u: no interface name in message, "
+@@ -541,6 +544,7 @@
+ }
+
+ entry = netsnmp_access_interface_entry_create(if_name, ifp->ifm_index);
++ free(if_name);
+ if(NULL == entry) {
+ netsnmp_access_interface_container_free(container,
+ NETSNMP_ACCESS_INTERFACE_FREE_NOFLAGS);
More information about the svn-ports-all
mailing list