aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-11-13 21:47:41 -0500
committerIan Moffett <ian@osmora.org>2024-11-13 21:47:41 -0500
commitfa8c57777ca97b94c2cf9b17fcb6941668255320 (patch)
tree9ba4f510a90139586f2de983d8823847a9e4431f
parent140972727f77ae91085be934ca5376a66676a7c9 (diff)
kernel: sysctl: Fix handling of oldlenpmain
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/kern/kern_sysctl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 6334d06..ae724b7 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -231,7 +231,11 @@ sysctl(struct sysctl_args *args)
memcpy(args->oldp, &tmp_int, oldlen);
}
- return (len > oldlen) ? -ENOMEM : 0;
+ if (args->oldlenp != NULL && len > oldlen) {
+ return -ENOMEM;
+ }
+
+ return 0;
}
scret_t