Fix portability warning from coverity

CID 344928 (#1 of 1): Sizeof not portable (SIZEOF_MISMATCH)
suspicious_sizeof: Passing argument object_handles of type CK_OBJECT_HANDLE_PTR and argument objects_length * 8UL /* sizeof (CK_OBJECT_HANDLE_PTR) */ to function realloc is suspicious. In this case, sizeof (CK_OBJECT_HANDLE_PTR) is equal to sizeof (CK_OBJECT_HANDLE), but this is not a portable assumption.
This commit is contained in:
Jakub Jelen 2019-07-26 11:04:14 +02:00 committed by Frank Morgner
parent 1a0a8e637b
commit 9b47462a51
1 changed files with 1 additions and 1 deletions

View File

@ -444,7 +444,7 @@ int search_objects(test_certs_t *objects, token_info_t *info,
/* store handle */
if (i >= objects_length) {
objects_length += 4; // do not realloc after each row
object_handles = realloc(object_handles, objects_length * sizeof(CK_OBJECT_HANDLE_PTR));
object_handles = realloc(object_handles, objects_length * sizeof(CK_OBJECT_HANDLE));
if (object_handles == NULL) {
fail_msg("Realloc failed. Need to store object handles.\n");
return -1;