From: Dan Streetman Date: Mon, 21 Aug 2023 22:10:56 +0000 (-0400) Subject: tpm2: use memcpy_safe() instead of memcpy() X-Git-Tag: v255-rc1~630^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=65fd657e0a13c0fdd4221cf6f22d51462a0bbc10;p=thirdparty%2Fsystemd.git tpm2: use memcpy_safe() instead of memcpy() --- diff --git a/src/shared/tpm2-util.h b/src/shared/tpm2-util.h index 6883975174a..e62a3c30e12 100644 --- a/src/shared/tpm2-util.h +++ b/src/shared/tpm2-util.h @@ -199,7 +199,7 @@ int tpm2_tpm2b_public_to_fingerprint(const TPM2B_PUBLIC *public, void **ret_fing struct_type UNIQ_T(STRUCT, uniq) = { .size_field = UNIQ_T(SIZE, uniq), }; \ assert(sizeof(UNIQ_T(STRUCT, uniq).buffer_field) >= (size_t) UNIQ_T(SIZE, uniq)); \ if (UNIQ_T(BUF, uniq)) \ - memcpy(UNIQ_T(STRUCT, uniq).buffer_field, UNIQ_T(BUF, uniq), UNIQ_T(SIZE, uniq)); \ + memcpy_safe(UNIQ_T(STRUCT, uniq).buffer_field, UNIQ_T(BUF, uniq), UNIQ_T(SIZE, uniq)); \ UNIQ_T(STRUCT, uniq); \ })