From: rousskov <> Date: Wed, 23 Jan 2008 04:07:19 +0000 (+0000) Subject: Author: Klaus Singvogel X-Git-Tag: BASIC_TPROXY4~157 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=baad8a1f4586e6258d873fa25c8066661fb8dc4f;p=thirdparty%2Fsquid.git Author: Klaus Singvogel Bug 2189 fix: when dumping SNMP oids, do not overrun the result buffer. --- diff --git a/src/snmp_core.cc b/src/snmp_core.cc index 57bc0627da..abec1f878c 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -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);