]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Set the buffer size to the new maximum length for a digest.
authorminfrin <minfrin@users.noreply.github.com>
Mon, 1 Nov 2021 09:54:59 +0000 (11:54 +0200)
committerMatthias Runge <mrunge@matthias-runge.de>
Wed, 10 Nov 2021 10:52:45 +0000 (11:52 +0100)
src/snmp.c

index 401de7414f0c807ad102949e4b034ddb73ae02f3..39bbab66a57d73006c0800637cd9a026e73a003a 100644 (file)
@@ -36,6 +36,9 @@
 
 #include <fnmatch.h>
 
+/* SHA512 plus a trailing nul */
+#define MAX_DIGEST_NAME_LEN 7
+
 /*
  * Private data structes
  */
@@ -667,7 +670,7 @@ static int csnmp_config_add_host_collect(host_definition_t *host,
 
 static int csnmp_config_add_host_auth_protocol(host_definition_t *hd,
                                                oconfig_item_t *ci) {
-  char buffer[4];
+  char buffer[MAX_DIGEST_NAME_LEN];
   int status;
 
   status = cf_util_get_string_buffer(ci, buffer, sizeof(buffer));