aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_filedesc.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-22 22:44:12 -0400
committerIan Moffett <ian@osmora.org>2024-03-22 22:44:12 -0400
commit08fc6b992dc439e5e2d3c9963524a8d7fe08b0e9 (patch)
treedc05ae37aa823542a01c6b2aa1bdbbb9c2e13a2e /sys/kern/kern_filedesc.c
parent4dff49297e2ad8a9ae0f0e0b9bb2630c0af39b35 (diff)
kernel: filedesc: Handle count of 0
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/kern/kern_filedesc.c')
-rw-r--r--sys/kern/kern_filedesc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_filedesc.c b/sys/kern/kern_filedesc.c
index dea5a43..72f9c06 100644
--- a/sys/kern/kern_filedesc.c
+++ b/sys/kern/kern_filedesc.c
@@ -54,7 +54,7 @@ make_write_buf(struct proc *td, const void *data, char **buf_out, size_t count)
const size_t MAX_COUNT = 0x7FFFF000;
char *buf = NULL;
- if (count > MAX_COUNT) {
+ if (count > MAX_COUNT || count == 0) {
return -EINVAL;
}