cryptsetup: Fix null pointer dereference (#16987)

cryptsetup: Fix null pointer dereference

Fix null pointer dereference in the pkcs11 related code of systemd-cryptsetup
This commit is contained in:
Mikael Szreder 2020-09-09 21:26:21 +02:00 committed by GitHub
parent 197db625a3
commit 664ad0f6f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -212,13 +212,15 @@ int pkcs11_token_login(
"Failed to log into security token '%s': %s", token_label, p11_kit_strerror(rv));
log_info("Successfully logged into security token '%s' via protected authentication path.", token_label);
*ret_used_pin = NULL;
if (ret_used_pin)
*ret_used_pin = NULL;
return 0;
}
if (!FLAGS_SET(token_info->flags, CKF_LOGIN_REQUIRED)) {
log_info("No login into security token '%s' required.", token_label);
*ret_used_pin = NULL;
if (ret_used_pin)
*ret_used_pin = NULL;
return 0;
}