components/net-snmp/patches/051.19616471.patch
author Tomas Klacko <tomas.klacko@oracle.com>
Thu, 18 Sep 2014 09:47:48 -0700
changeset 2096 ea57cc1059bf
permissions -rw-r--r--
19616471 problem in UTILITY/NET-SNMP

http://sourceforge.net/p/net-snmp/code/ci/76e8d6d100320629d8a23be4b0128619600c919d/
https://security-tracker.debian.org/tracker/CVE-2014-2285

diff --git a/perl/TrapReceiver/TrapReceiver.xs b/perl/TrapReceiver/TrapReceiver.xs
index d4ccac9..0ab1a81 100644
--- a/perl/TrapReceiver/TrapReceiver.xs
+++ b/perl/TrapReceiver/TrapReceiver.xs
@@ -73,18 +73,18 @@ int   perl_trapd_handler( netsnmp_pdu           *pdu,
         STOREPDUi("securitymodel", pdu->securityModel);
         STOREPDUi("securitylevel", pdu->securityLevel);
         STOREPDU("contextName",
-                 newSVpv(pdu->contextName, pdu->contextNameLen));
+                 newSVpv(pdu->contextName ? pdu->contextName : "", pdu->contextNameLen));
         STOREPDU("contextEngineID",
-                 newSVpv(pdu->contextEngineID,
+                 newSVpv(pdu->contextEngineID ? (char *) pdu->contextEngineID : "",
                                     pdu->contextEngineIDLen));
         STOREPDU("securityEngineID",
-                 newSVpv(pdu->securityEngineID,
+                 newSVpv(pdu->securityEngineID ? (char *) pdu->securityEngineID : "",
                                     pdu->securityEngineIDLen));
         STOREPDU("securityName",
-                 newSVpv(pdu->securityName, pdu->securityNameLen));
+                 newSVpv(pdu->securityName ? (char *) pdu->securityName : "", pdu->securityNameLen));
     } else {
         STOREPDU("community",
-                 newSVpv(pdu->community, pdu->community_len));
+                 newSVpv(pdu->community ? (char *) pdu->community : "", pdu->community_len));
     }
 
     if (transport && transport->f_fmtaddr) {