summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Szreder <miszr@users.noreply.github.com>2020-09-09 21:26:21 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-09-11 20:07:09 +0200
commitf3da0180170deac1a95f8c08c007046227cdbfc7 (patch)
tree9ffd415d48c711012b0f0767d8c828853877db95
parent6f65eaf9c2643e0d9e22357f41f0b3d29e18075a (diff)
downloadsystemd-f3da0180170deac1a95f8c08c007046227cdbfc7.tar.gz
cryptsetup: Fix null pointer dereference (#16987)
cryptsetup: Fix null pointer dereference Fix null pointer dereference in the pkcs11 related code of systemd-cryptsetup (cherry picked from commit 664ad0f6f54257643fa069d9e1e9cad0f6fd7cc3)
-rw-r--r--src/shared/pkcs11-util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/shared/pkcs11-util.c b/src/shared/pkcs11-util.c
index 632964df44..4088439f93 100644
--- a/src/shared/pkcs11-util.c
+++ b/src/shared/pkcs11-util.c
@@ -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;
}