Fix: mmap len cannot be zero

This commit is contained in:
Jianfeng Jiang 2024-08-16 06:11:22 +00:00 committed by Tate, Hongliang Tian
parent 32a1a53ee7
commit 212440dbb1

View File

@ -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 {