From eb8f5859b1349f8147ba47a1da8032df192f2370 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 17 Jul 2013 08:03:38 +0200 Subject: Fix various issues highlighted by coverity scanner Among others fix possible usage of large stack allocation. --- trust/tests/test-index.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'trust/tests/test-index.c') diff --git a/trust/tests/test-index.c b/trust/tests/test-index.c index cf856ee..074ab2d 100644 --- a/trust/tests/test-index.c +++ b/trust/tests/test-index.c @@ -397,6 +397,7 @@ handles_are (CK_OBJECT_HANDLE *handles, ...) { CK_OBJECT_HANDLE handle; + bool matched = true; int count; int num; va_list va; @@ -410,7 +411,7 @@ handles_are (CK_OBJECT_HANDLE *handles, va_start (va, handles); - for (count = 0; true; count++) { + for (count = 0; matched; count++) { handle = va_arg (va, CK_OBJECT_HANDLE); if (handle == 0) break; @@ -421,12 +422,12 @@ handles_are (CK_OBJECT_HANDLE *handles, } if (handles[i] != handle) - return false; + matched = false; } va_end (va); - return (count == num); + return matched && (count == num); } static void -- cgit v1.1