]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
creds-util: fix NULL pointer dereference
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 Sep 2022 08:07:50 +0000 (17:07 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 Sep 2022 12:05:16 +0000 (21:05 +0900)
Fixes CID#1497840.

src/shared/creds-util.c

index 02d86207c20b6ab6e89d944f86f3b30f254febfe..ecf90e2084a1152ef397e4a867c5aedb8384fde8 100644 (file)
@@ -990,8 +990,9 @@ int decrypt_credential_and_warn(
                 r = tpm2_unseal(tpm2_device,
                                 le64toh(t->pcr_mask),
                                 le16toh(t->pcr_bank),
-                                z ? z->data : NULL, z ? le32toh(z->size) : 0,
-                                le64toh(z->pcr_mask),
+                                z ? z->data : NULL,
+                                z ? le32toh(z->size) : 0,
+                                z ? le64toh(z->pcr_mask) : 0,
                                 signature_json,
                                 /* pin= */ NULL,
                                 le16toh(t->primary_alg),