From 00aa0a0eb1c197d45701e4faa321cd7e256a5bfe Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 28 Jun 2024 23:51:54 -0400 Subject: kernel: fork: Ensure 'newproc' is zeroed Signed-off-by: Ian Moffett --- sys/kern/kern_fork.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/kern') diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index ce5f3a6..421f478 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -54,6 +54,7 @@ fork1(struct proc *cur, int flags, void(*ip)(void), struct proc **newprocp) if (newproc == NULL) return -ENOMEM; + memset(newproc, 0, sizeof(*newproc)); status = md_fork(newproc, cur, (uintptr_t)ip); if (status != 0) goto done; -- cgit v1.2.3