]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
free memory corruption introduced by the polishing of the SNMP tree generator.
authorHenrik Nordstrom <henrik@henriknordstrom.net>
Tue, 15 Jun 2010 22:52:16 +0000 (00:52 +0200)
committerHenrik Nordstrom <henrik@henriknordstrom.net>
Tue, 15 Jun 2010 22:52:16 +0000 (00:52 +0200)
src/snmp_core.cc

index 8e6adaf494f5a1ccdcef4e324c5cf9436d5d8a2d..63821ded41418a363a9c1d540e4b0b5f42499691 100644 (file)
@@ -963,9 +963,10 @@ snmpCreateOidFromStr(const char *str, oid **name, int *nl)
     *name = NULL;
     *nl = 0;
     char *s = xstrdup(str);
+    char *s_ = s;
 
     /* Parse the OID string into oid bits */
-    while ( (p = strsep(&s, delim)) != NULL) {
+    while ( (p = strsep(&s_, delim)) != NULL) {
         *name = (oid*)xrealloc(*name, sizeof(oid) * ((*nl) + 1));
         (*name)[*nl] = atoi(p);
         (*nl)++;