Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Sep 2019 19:41:48 +0000 (UTC)
From:      Kurt Jaeger <pi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r513264 - head/net-mgmt/net-snmp/files
Message-ID:  <201909291941.x8TJfmie088866@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@yuripv.net>
  Reviewed by:	Bart Van Assche <bvanassche@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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909291941.x8TJfmie088866>