net-snmp / net-snmp

A SNMP application library, tools and daemon
Other
336 stars 219 forks source link

Possible NULL dereference and access to freed memory in `_transport_common` function #865

Open PavlNekrasov opened 1 month ago

PavlNekrasov commented 1 month ago

If netsnmp_tlsbase_allocate_tlsdata fails to allocate memory for tlsdata, it returns NULL and free the memory previously allocated for t.

https://github.com/net-snmp/net-snmp/blob/41e711531fbb0fd8b2cb2370388a6430d6bbad1f/snmplib/transports/snmpDTLSUDPDomain.c#L1493-L1495

Found by Linux Verification Center (linuxtesting.org) with SVACE. Reporter: Pavel Nekrasov (p.nekrasov@fobos-nt.ru).