Fix index out of bound when `key` of `semget` too large
This commit is contained in:
parent
c68302f700
commit
42f3411337
|
|
@ -235,6 +235,9 @@ pub fn create_sem_set_with_id(
|
|||
) -> Result<()> {
|
||||
debug_assert!(nsems <= SEMMSL);
|
||||
debug_assert!(id > 0);
|
||||
if id as usize > SEMMNI {
|
||||
return_errno_with_message!(Errno::ENOENT, "id larger than SEMMNI");
|
||||
}
|
||||
|
||||
ID_ALLOCATOR
|
||||
.get()
|
||||
|
|
|
|||
Loading…
Reference in New Issue