]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix a minor off-by-one/C-style-string-assumption error in SNMP
authorhno <>
Wed, 13 Feb 2002 07:41:31 +0000 (07:41 +0000)
committerhno <>
Wed, 13 Feb 2002 07:41:31 +0000 (07:41 +0000)
community processing

snmplib/snmp_api.c

index d5ad882d5b715baa332282bcc4c37f4c8540e30a..7b296178e886cf50f1d09b9ca6b3b53a5c4e2beb 100644 (file)
@@ -146,6 +146,8 @@ snmp_parse(struct snmp_session * session,
     if (bufp == NULL)
        return (NULL);
 
-    strcpy((char *) bufp, (char *) Community);
+    strncpy((char *) bufp, (char *) Community, CommunityLen);
+    bufp[CommunityLen] = '\0';
+
     return (bufp);
 }