Code

zfs_arc plugin: leave enough room for terminating null
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 4 Dec 2015 20:09:02 +0000 (21:09 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 5 Dec 2015 07:41:18 +0000 (08:41 +0100)
CID #38028

Signed-off-by: Florian Forster <octo@collectd.org>
src/zfs_arc.c

index f0d23239a82ab158c03c669f9a96cf2fc7f8dd24..540a1db48683232c0cda930665d91cf08cfcd447 100644 (file)
@@ -186,7 +186,7 @@ static int za_read (void)
                return (-1);
        }
 
-       len = read_file_contents (ZOL_ARCSTATS_FILE, file_contents, sizeof(file_contents));
+       len = read_file_contents (ZOL_ARCSTATS_FILE, file_contents, sizeof(file_contents) - 1);
        if (len > 1)
        {