summaryrefslogtreecommitdiff
path: root/trust/tests/test-index.c
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-07-17 08:03:38 +0200
committerStef Walter <stef@thewalter.net>2013-07-18 07:56:01 +0200
commiteb8f5859b1349f8147ba47a1da8032df192f2370 (patch)
treea2fab941c7e96f641f99805ed701bded9366b9e2 /trust/tests/test-index.c
parentab1caffd9e09fd4d6ab92713de29436db0da6dea (diff)
Fix various issues highlighted by coverity scanner
Among others fix possible usage of large stack allocation.
Diffstat (limited to 'trust/tests/test-index.c')
-rw-r--r--trust/tests/test-index.c7
1 files changed, 4 insertions, 3 deletions
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