Initialize PSA key slot as invalid in ssl_client2.c
Otherwise, if `mbedtls_psa_get_free_key_slot()` fails to find a fresh key slot, the slot value will be undefined, and the call to `psa_destroy_key()` at the end of `main()` is undefined behavior.
This commit is contained in:
parent
e9bf0f4c32
commit
4097578207
1 changed files with 1 additions and 1 deletions
|
@ -561,7 +561,7 @@ int main( int argc, char *argv[] )
|
|||
const char *pers = "ssl_client2";
|
||||
|
||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||
psa_key_slot_t slot;
|
||||
psa_key_slot_t slot = 0;
|
||||
psa_algorithm_t alg = 0;
|
||||
psa_key_policy_t policy;
|
||||
psa_status_t status;
|
||||
|
|
Loading…
Reference in a new issue