From b777ca5fa19f56a0978a6d167d30aa94de9571fd Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Mon, 3 Nov 2025 03:52:55 +0000 Subject: [PATCH] SNMP: Clear community aliases to avoid dangling pointer (#2215) Currently not a issue, but reduces UAF hazard in the future --- src/snmp_core.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/snmp_core.cc b/src/snmp_core.cc index ffd93c2063..c28a412241 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -423,7 +423,9 @@ snmpDecodePacket(SnmpRequest * rq) snmp_free_pdu(PDU); } xfree(Community); - + rq->community = nullptr; + rq->session.community = nullptr; + rq->session.community_len = 0; } else { debugs(49, DBG_IMPORTANT, "WARNING: Failed SNMP agent query from : " << rq->from); snmp_free_pdu(PDU); -- 2.47.3