]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tpm2: use SIZE_MAX instead of strlen() for unhexmem()
authorDan Streetman <ddstreet@ieee.org>
Mon, 21 Aug 2023 20:29:44 +0000 (16:29 -0400)
committerDan Streetman <ddstreet@ieee.org>
Thu, 24 Aug 2023 16:33:26 +0000 (12:33 -0400)
src/shared/tpm2-util.c

index f4b9f4ff33d04704dac935465cf55d613bb4ceed..794474776b0e03de9d69589ca15bb1d412384e50 100644 (file)
@@ -1738,7 +1738,7 @@ int tpm2_pcr_value_from_string(const char *arg, Tpm2PCRValue *ret_pcr_value) {
 
                 _cleanup_free_ void *buf = NULL;
                 size_t buf_size = 0;
-                r = unhexmem(p, strlen(p), &buf, &buf_size);
+                r = unhexmem(p, SIZE_MAX, &buf, &buf_size);
                 if (r < 0)
                         return log_error_errno(r, "Invalid pcr hash value '%s': %m", p);