From ed227063379172827eca37fb52c73209db2c38f6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 23 Sep 2015 18:09:22 -0700 Subject: [PATCH] Fix out-of-bounds access to the array The array has TIMEOUTS elements, so timeout_list[TIMEOUTS] is one element past the end. Change-Id: I42e7ef1a481840699a8dffff1406c4b42d42fde1 Signed-off-by: Thiago Macieira Reviewed-on: https://gerrit.iotivity.org/gerrit/3017 Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- extlibs/timer/timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extlibs/timer/timer.c b/extlibs/timer/timer.c index d86bdef..29c9ceb 100755 --- a/extlibs/timer/timer.c +++ b/extlibs/timer/timer.c @@ -327,7 +327,7 @@ time_t registerTimer(const time_t seconds, int *id, void (*cb)()) void unregisterTimer(int idx) { - if( 0 <= idx && idx <= TIMEOUTS) + if( 0 <= idx && idx < TIMEOUTS) timeout_list[idx].timeout_state = TIMEOUT_UNUSED; } -- 2.7.4