mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-18 12:06:43 +00:00
Fix reachable unwrap panic in check_sem()
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
a039b58f8b
commit
42f70fd779
@ -16,6 +16,9 @@ pub fn sys_semget(key: i32, nsems: i32, semflags: i32, ctx: &Context) -> Result<
|
||||
if nsems < 0 || nsems as usize > SEMMSL {
|
||||
return_errno!(Errno::EINVAL);
|
||||
}
|
||||
if key < 0 {
|
||||
return_errno!(Errno::EINVAL);
|
||||
}
|
||||
|
||||
let flags = IpcFlags::from_bits_truncate(semflags as u32);
|
||||
let mode: u16 = (semflags as u32 & 0x1FF) as u16;
|
||||
|
Reference in New Issue
Block a user