Add guard in thread_set_priority ensuring priority values are within correct range
This commit is contained in:
@@ -354,6 +354,7 @@ thread_foreach (thread_action_func *func, void *aux)
|
||||
void
|
||||
thread_set_priority (int new_priority)
|
||||
{
|
||||
ASSERT (PRI_MIN <= new_priority && new_priority <= PRI_MAX);
|
||||
thread_current ()->priority = new_priority;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user