From: Joshua Rogers Date: Mon, 3 Nov 2025 03:52:55 +0000 (+0000) Subject: SNMP: Clear community aliases to avoid dangling pointer (#2215) X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;p=thirdparty%2Fsquid.git SNMP: Clear community aliases to avoid dangling pointer (#2215) Currently not a issue, but reduces UAF hazard in the future --- 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);