]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tpm2: move cast from lhs to rhs in uint16_t/int comparison
authorDan Streetman <ddstreet@ieee.org>
Mon, 21 Aug 2023 14:42:35 +0000 (10:42 -0400)
committerDan Streetman <ddstreet@ieee.org>
Thu, 24 Aug 2023 16:31:00 +0000 (12:31 -0400)
src/shared/tpm2-util.c

index cc90a379f892b1ce637b33129de0986157321d78..51cb1beeb929a8f2dbaad8800cffc894f9ccc872 100644 (file)
@@ -1537,7 +1537,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;