Add guard in thread_set_priority ensuring priority values are within correct range

This commit is contained in:
Themis Demetriades
2024-10-15 10:47:38 +01:00
parent 0a9cf6f242
commit 4ed64cf173

View File

@@ -354,6 +354,7 @@ thread_foreach (thread_action_func *func, void *aux)
void void
thread_set_priority (int new_priority) thread_set_priority (int new_priority)
{ {
ASSERT (PRI_MIN <= new_priority && new_priority <= PRI_MAX);
thread_current ()->priority = new_priority; thread_current ()->priority = new_priority;
} }