mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 18:03:25 +00:00
Fix index out of bound when key
of semget
too large
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
c68302f700
commit
42f3411337
@ -235,6 +235,9 @@ pub fn create_sem_set_with_id(
|
|||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
debug_assert!(nsems <= SEMMSL);
|
debug_assert!(nsems <= SEMMSL);
|
||||||
debug_assert!(id > 0);
|
debug_assert!(id > 0);
|
||||||
|
if id as usize > SEMMNI {
|
||||||
|
return_errno_with_message!(Errno::ENOENT, "id larger than SEMMNI");
|
||||||
|
}
|
||||||
|
|
||||||
ID_ALLOCATOR
|
ID_ALLOCATOR
|
||||||
.get()
|
.get()
|
||||||
|
Reference in New Issue
Block a user