]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Klaus Singvogel <kssingvo@suse.de>
authorrousskov <>
Wed, 23 Jan 2008 04:07:19 +0000 (04:07 +0000)
committerrousskov <>
Wed, 23 Jan 2008 04:07:19 +0000 (04:07 +0000)
Bug 2189 fix: when dumping SNMP oids, do not overrun the result buffer.

src/snmp_core.cc

index 57bc0627da277f0b58c1f92741c96dba1a1d2fe6..abec1f878ca3b8dab03541f807fe56cc4498134c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: snmp_core.cc,v 1.81 2007/12/18 23:24:25 amosjeffries Exp $
+ * $Id: snmp_core.cc,v 1.82 2008/01/22 21:07:19 rousskov Exp $
  *
  * DEBUG: section 49    SNMP support
  * AUTHOR: Glenn Chisholm
@@ -1087,7 +1087,7 @@ snmpDebugOid(int lvl, oid * Name, snint Len)
 
     for (x = 0; x < Len; x++) {
         snprintf(mbuf, sizeof(mbuf), ".%u", (unsigned int) Name[x]);
-        strncat(objid, mbuf, sizeof(objid));
+        strncat(objid, mbuf, sizeof(objid) - strlen(objid) - 1);
     }
 
     debugs(49, lvl, "   oid = " << objid);