5865N/A# remote attackers to cause a denial of service (snmptrapd crash) via an empty
5865N/A# community string in an SNMP trap, which triggers a NULL pointer dereference
5865N/A# within the newSVpv function in Perl.
5865N/A# Fix picked from upstream. Will be available in 5.7.3 and above.
3181N/A STOREPDUi("securitymodel", pdu->securityModel);
3181N/A STOREPDUi("securitylevel", pdu->securityLevel);
3181N/A- newSVpv(pdu->contextName, pdu->contextNameLen));
3181N/A+ newSVpv(pdu->contextName ? pdu->contextName : "", pdu->contextNameLen));
3181N/A STOREPDU("contextEngineID",
5865N/A- newSVpv((char *) pdu->contextEngineID,
3181N/A+ newSVpv(pdu->contextEngineID ? (char *) pdu->contextEngineID : "",
3181N/A STOREPDU("securityEngineID",
5865N/A- newSVpv((char *) pdu->securityEngineID,
3181N/A+ newSVpv(pdu->securityEngineID ? (char *) pdu->securityEngineID : "",
3181N/A pdu->securityEngineIDLen));
5865N/A- newSVpv((char *) pdu->securityName, pdu->securityNameLen));
3181N/A+ newSVpv(pdu->securityName ? (char *) pdu->securityName : "", pdu->securityNameLen));
5865N/A- newSVpv((char *) pdu->community, pdu->community_len));
3181N/A+ newSVpv(pdu->community ? (char *) pdu->community : "", pdu->community_len));
3181N/A if (transport && transport->f_fmtaddr) {