File net-snmp-5.7.2-fix-perl-trap-handler.patch of Package net-snmp.986

diff -Nur net-snmp-5.7.2.1-orig/perl/TrapReceiver/TrapReceiver.xs net-snmp-5.7.2.1/perl/TrapReceiver/TrapReceiver.xs
--- net-snmp-5.7.2.1-orig/perl/TrapReceiver/TrapReceiver.xs	2014-02-20 01:36:42.000000000 +0100
+++ net-snmp-5.7.2.1/perl/TrapReceiver/TrapReceiver.xs	2014-09-02 12:06:50.070037000 +0200
@@ -81,18 +81,18 @@
         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((char *) pdu->contextEngineID,
+                 newSVpv(pdu->contextEngineID ? (char *) pdu->contextEngineID : "",
                                     pdu->contextEngineIDLen));
         STOREPDU("securityEngineID",
-                 newSVpv((char *) pdu->securityEngineID,
+                 newSVpv(pdu->securityEngineID ? (char *) pdu->securityEngineID : "",
                                     pdu->securityEngineIDLen));
         STOREPDU("securityName",
-                 newSVpv((char *) pdu->securityName, pdu->securityNameLen));
+                 newSVpv(pdu->securityName ? (char *) pdu->securityName : "", pdu->securityNameLen));
     } else {
         STOREPDU("community",
-                 newSVpv((char *) pdu->community, pdu->community_len));
+                 newSVpv(pdu->community ? (char *) pdu->community : "", pdu->community_len));
     }
 
     if (transport && transport->f_fmtaddr) {
openSUSE Build Service is sponsored by