From 08fc6b992dc439e5e2d3c9963524a8d7fe08b0e9 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 22 Mar 2024 22:44:12 -0400 Subject: kernel: filedesc: Handle count of 0 Signed-off-by: Ian Moffett --- sys/kern/kern_filedesc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys') 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; } -- cgit v1.2.3