From: Dan Streetman Date: Mon, 21 Aug 2023 20:29:44 +0000 (-0400) Subject: tpm2: use SIZE_MAX instead of strlen() for unhexmem() X-Git-Tag: v255-rc1~630^2~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7001a7daf7b2cf67991acc8383a58ff71432188c;p=thirdparty%2Fsystemd.git tpm2: use SIZE_MAX instead of strlen() for unhexmem() --- diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c index f4b9f4ff33d..794474776b0 100644 --- a/src/shared/tpm2-util.c +++ b/src/shared/tpm2-util.c @@ -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);