Commit 130652ef authored by Dmitrii Golovanov's avatar Dmitrii Golovanov Committed by Anas Nashif
Browse files

tests: ztest: ztress: Fix out-of-bounds at ztress_execute



Fix ztress_execute() out-of-bounds in case it is called with timer
and for maximum number of threads allowed (CONFIG_ZTRESS_MAX_THREADS).

Signed-off-by: default avatarDmitrii Golovanov <dmitrii.golovanov@intel.com>
parent 0143852b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -325,7 +325,7 @@ int ztress_execute(struct ztress_context_data *timer_data,
	int old_prio = k_thread_priority_get(k_current_get());
	int priority, ztress_prio = 0;

	if (cnt > CONFIG_ZTRESS_MAX_THREADS) {
	if ((cnt + (timer_data ? 1 : 0)) > CONFIG_ZTRESS_MAX_THREADS) {
		return -EINVAL;
	}