mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-16 08:46:48 +00:00
Fix: mmap len cannot be zero
This commit is contained in:
parent
32a1a53ee7
commit
212440dbb1
@ -54,6 +54,10 @@ fn do_sys_mmap(
|
||||
|
||||
check_option(&option)?;
|
||||
|
||||
if len == 0 {
|
||||
return_errno_with_message!(Errno::EINVAL, "mmap len cannot be zero");
|
||||
}
|
||||
|
||||
let len = len.align_up(PAGE_SIZE);
|
||||
|
||||
if offset % PAGE_SIZE != 0 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user