net-snmp / net-snmp

A SNMP application library, tools and daemon

Repository from Github https://github.comnet-snmp/net-snmpRepository from Github https://github.comnet-snmp/net-snmp

Possible dereference of NULL

VoroninArtemii opened this issue · comments

There is a possible dereference of iflist = NULL inside linux_freeinternalnameindex because since we are allocating memory but it may fail:

tmp =
realloc(iflist,
(sizeof(struct if_nameindex)) * (last_if_count +
2));
if (!tmp) {
linux_freeinternalnameindex(iflist, if_index);
if_count = 0;
iflist = NULL;
break;
}

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.
Author A. Voronin.