#
# netsnmp_access_ipaddress_container_load() can return NULL.
# ipaddressTable_container_load() should check for the validity
# of return value before accessing it or else it causes SEGV.
#
# Developed in-house. Bug submitted upstream
# https://sourceforge.net/p/net-snmp/bugs/2589
#
--- net-snmp-5.9.4/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c.orig
+++ net-snmp-5.9.4/agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
@@ -370,6 +370,8 @@
      * missing addresses to be deleted. Also, prune interfaces in
      * ipaddress_container, so only the new interfaces remain.
      */
+    if(ipaddress_container != NULL)
+    {
     tmp_ptr[0] = ipaddress_container->next;
     tmp_ptr[1] = NULL; /* list of interfaces to be removed from 'container' */
     tmp_ptr[2] = NULL; /* list of interfaces to be ignored in ipaddress_container */
@@ -434,6 +436,7 @@
         }
         CONTAINER_FREE(to_ignore);
     }
+    }
 
     DEBUGMSGT(("verbose:ipAddressTable:ipAddressTable_cache_load",
                "%lu records\n", (unsigned long)CONTAINER_SIZE(container)));