]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
SNMP: Clear community aliases to avoid dangling pointer (#2215) master
authorJoshua Rogers <MegaManSec@users.noreply.github.com>
Mon, 3 Nov 2025 03:52:55 +0000 (03:52 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 3 Nov 2025 03:54:17 +0000 (03:54 +0000)
Currently not a issue, but reduces UAF hazard in the future

src/snmp_core.cc

index ffd93c2063614d7eb68c4fee49a757e73b170972..c28a412241bbe5a546aa39d5a7c13e8a6120399b 100644 (file)
@@ -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);