From c2d41180f071be5d2541a6afd5c3fc07dfb407e3 Mon Sep 17 00:00:00 2001 From: amosjeffries <> Date: Wed, 27 Feb 2008 17:11:47 +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 2e006cacca..bc93140b3a 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.cc,v 1.79 2007/07/06 11:30:45 amosjeffries Exp $ + * $Id: snmp_core.cc,v 1.79.4.1 2008/02/27 10:11:47 amosjeffries Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -1106,7 +1106,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.2