From baad8a1f4586e6258d873fa25c8066661fb8dc4f Mon Sep 17 00:00:00 2001 From: rousskov <> Date: Wed, 23 Jan 2008 04:07:19 +0000 Subject: [PATCH] Author: Klaus Singvogel Bug 2189 fix: when dumping SNMP oids, do not overrun the result buffer. --- src/snmp_core.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.47.3