kloczek / rpms / net-snmp

Forked from rpms/net-snmp 6 years ago
Clone
d353462
diff -urNp net-snmp-5.7.3/snmplib/snmp_transport.c net-snmp-5.7.3.new/snmplib/snmp_transport.c
d353462
--- net-snmp-5.7.3/snmplib/snmp_transport.c	2014-12-08 21:23:22.000000000 +0100
d353462
+++ net-snmp-5.7.3.new/snmplib/snmp_transport.c	2016-08-12 13:04:35.438583586 +0200
d353462
@@ -594,12 +594,13 @@ netsnmp_tdomain_transport_full(const cha
d353462
                 int commas = 0;
d353462
                 const char *cp = default_domain;
d353462
                 char *dup = strdup(default_domain);
d353462
+                char *ptr = NULL;
d353462
 
d353462
                 while (*++cp) if (*cp == ',') commas++;
d353462
                 lspec = calloc(commas+2, sizeof(char *));
d353462
                 commas = 1;
d353462
-                lspec[0] = strtok(dup, ",");
d353462
-                while ((lspec[commas++] = strtok(NULL, ",")))
d353462
+                lspec[0] = strtok_r(dup, ",", &ptr);
d353462
+                while ((lspec[commas++] = strtok_r(NULL, ",", &ptr)))
d353462
                     ;
d353462
                 spec = (const char * const *)lspec;
d353462
             }