systemd/0589-tpm2-use-strempty.patch
Jan Macku e5f65c3fc6 systemd-252-27
Resolves: RHEL-1086,RHEL-11591,RHEL-16182,RHEL-19483,RHEL-7026
2024-02-15 09:36:23 +01:00

26 lines
917 B
Diff

From cc0d6f06461c16835a0d01e6a62a5e14dd566823 Mon Sep 17 00:00:00 2001
From: Dan Streetman <ddstreet@ieee.org>
Date: Mon, 21 Aug 2023 17:39:20 -0400
Subject: [PATCH] tpm2: use strempty()
(cherry picked from commit 85b6f299b2ae11ea589d373559d43cfe88c8d30f)
Related: RHEL-16182
---
src/shared/tpm2-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c
index d0217e4655..5508763a38 100644
--- a/src/shared/tpm2-util.c
+++ b/src/shared/tpm2-util.c
@@ -1766,7 +1766,7 @@ char *tpm2_pcr_value_to_string(const Tpm2PCRValue *pcr_value) {
return NULL;
}
- return strjoin(index, hash ? ":" : "", hash ?: "", value ? "=" : "", value ?: "");
+ return strjoin(index, hash ? ":" : "", strempty(hash), value ? "=" : "", strempty(value));
}
/* Parse a string argument into an array of Tpm2PCRValue objects.