tests: context: Verify for out of bounds array
The for loop could exit with a out of bounds (variable j) value for the delayed_threads array, we verify for the variable value before operating on the array This issue was reported by Coverity Coverity-CID: 160078 Change-Id: I6aa1cc325cc363be48cd72b2a58d0a55ec3854bc Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
This commit is contained in:
parent
678d1ba986
commit
fdf9238382
1 changed files with 6 additions and 3 deletions
|
@ -784,9 +784,12 @@ static int test_timeout(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
k_thread_cancel(delayed_threads[j]);
|
||||
++next_cancellation;
|
||||
continue;
|
||||
|
||||
if (j < NUM_TIMEOUT_THREADS) {
|
||||
k_thread_cancel(delayed_threads[j]);
|
||||
++next_cancellation;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
data = k_fifo_get(&timeout_order_fifo, 2750);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue