From 44f52365f1332c689c701d79e1f3cec00b0c6659 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 6 Aug 2025 13:39:24 -0400 Subject: kernel: vcache: Include '\0' in sysctl string The strlen() function does not count the null terminator when measuring the length of the string and therefore a value of 1 must be added to do so. Signed-off-by: Ian Moffett --- sys/kern/vfs_vcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/kern/vfs_vcache.c b/sys/kern/vfs_vcache.c index 25e244c..6c08caf 100644 --- a/sys/kern/vfs_vcache.c +++ b/sys/kern/vfs_vcache.c @@ -161,7 +161,7 @@ vfs_vcache_migrate(int newtype) args.oldp = NULL; args.oldlenp = NULL; args.newp = sysctl_val; - args.newlen = strlen(sysctl_val); + args.newlen = strlen(sysctl_val) + 1; if ((retval = sysctl(&args)) != 0) { return retval; -- cgit v1.2.3