systemd/0582-tpm2-move-cast-from-lhs-to-rhs-in-uint16_t-int-compa.patch

26 lines
1.0 KiB
Diff
Raw Normal View History

From 02dd9a1dfcb52b0e078945b15a87469f20762610 Mon Sep 17 00:00:00 2001
From: Dan Streetman <ddstreet@ieee.org>
Date: Mon, 21 Aug 2023 10:42:35 -0400
Subject: [PATCH] tpm2: move cast from lhs to rhs in uint16_t/int comparison
(cherry picked from commit 3cd4145f347461018fe79263534f59df6d3cde7a)
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 2dbd4eae8b..2c5d1741e7 100644
--- a/src/shared/tpm2-util.c
+++ b/src/shared/tpm2-util.c
@@ -1532,7 +1532,7 @@ bool tpm2_pcr_value_valid(const Tpm2PCRValue *pcr_value) {
if (r < 0)
return false;
- if ((int) pcr_value->value.size != r) {
+ if (pcr_value->value.size != (size_t) r) {
log_debug("PCR hash 0x%" PRIx16 " expected size %d does not match actual size %" PRIu16 ".",
pcr_value->hash, r, pcr_value->value.size);
return false;