From abaaf89d690d2f97cd38cc8d8f093854caad6439 Mon Sep 17 00:00:00 2001 From: Benjamin Walsh Date: Mon, 16 Jan 2017 09:50:09 -0500 Subject: [PATCH] tests/context: fix Coverity warning about array overrun Coverity was warning about an array overrun that should never happen. Add an extra check to verify that is indeed the case. Coverity issue 152017. Change-Id: Ie6269acaa85387ba051dbff87b4bfaab860517a6 Signed-off-by: Benjamin Walsh --- tests/legacy/kernel/test_context/src/context.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/legacy/kernel/test_context/src/context.c b/tests/legacy/kernel/test_context/src/context.c index 47305d5bca2..108d7500f49 100644 --- a/tests/legacy/kernel/test_context/src/context.c +++ b/tests/legacy/kernel/test_context/src/context.c @@ -760,6 +760,12 @@ static int test_timeout(void) break; } } + + if (j == NUM_TIMEOUT_FIBERS) { + TC_ERROR(" *** array overrun: all timeout order values should have been between the boundaries\n"); + return TC_FAIL; + } + task_fiber_delayed_start_cancel(delayed_fibers[j]); ++next_cancellation; continue;