diff options
author | Ian Moffett <ian@osmora.org> | 2024-11-13 21:47:41 -0500 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2024-11-13 21:47:41 -0500 |
commit | fa8c57777ca97b94c2cf9b17fcb6941668255320 (patch) | |
tree | 9ba4f510a90139586f2de983d8823847a9e4431f /sys | |
parent | 140972727f77ae91085be934ca5376a66676a7c9 (diff) |
kernel: sysctl: Fix handling of oldlenpmain
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_sysctl.c | 6 |
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 |