From 5bc05383695260895b44203c3278d2f761e1f637 Mon Sep 17 00:00:00 2001 From: jewelcodes Date: Fri, 29 Nov 2024 19:28:09 -0500 Subject: [PATCH] mm: typo in mmap() input validation --- src/memory/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/memory/mmap.c b/src/memory/mmap.c index 92fcfcb..f867744 100644 --- a/src/memory/mmap.c +++ b/src/memory/mmap.c @@ -36,7 +36,7 @@ void *mmap(Thread *t, uint64_t id, void *addr, size_t len, int prot, int flags, if(!p) return (void *) -ESRCH; IODescriptor *io = &p->io[fd]; - if(io->valid || !io->data) return (void *) -EBADF; + if(!io->valid || !io->data) return (void *) -EBADF; if(io->type != IO_FILE) return (void *) -ENODEV; FileDescriptor *f = (FileDescriptor *) io->data;