An upcoming patch will touch gnutls_pkcs11_privkey_init(), which is
sufficient to make the cppcheck portion of CI choke on a false
positive in the unrelated gnutls_pkcs11_privkey_import_url() because
the file becomes interesting again. cppcheck is not smart enough to
realize that an out-of-scope memory reference stored in a[1] is not
going to be utilized by the later pkcs11_get_attribute_value(..., a,
1) outside the if block; but the solution is as simple as expanding
the scope of tval.
Signed-off-by: Eric Blake <eblake@redhat.com>
struct ck_attribute a[4];
ck_key_type_t key_type;
ck_bool_t reauth = 0;
+ ck_bool_t tval;
PKCS11_CHECK_INIT;
if (pkey->pk_algorithm == GNUTLS_PK_RSA) { /* determine whether it can do rsa-pss */
- ck_bool_t tval = 0;
-
+ tval = 0;
a[0].type = CKA_MODULUS;
a[0].value = NULL;
a[0].value_len = 0;