Merge branch 'collectd-5.7' into collectd-5.8
[collectd.git] / src / nfs.c
index b556307..0fc9f3a 100644 (file)
--- a/src/nfs.c
+++ b/src/nfs.c
@@ -520,7 +520,8 @@ static int nfs_submit_nfs4_client(const char *instance, char **fields,
 static void nfs_read_linux(FILE *fh, const char *inst) {
   char buffer[1024];
 
-  char *fields[64];
+  // The stats line is prefixed with type and number of fields, thus plus 2
+  char *fields[MAX(NFS4_SERVER_MAX_PROC, NFS4_CLIENT_MAX_PROC) + 2];
   int fields_num = 0;
 
   if (fh == NULL)