]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tpm2: use memcpy_safe() instead of memcpy()
authorDan Streetman <ddstreet@ieee.org>
Mon, 21 Aug 2023 22:10:56 +0000 (18:10 -0400)
committerDan Streetman <ddstreet@ieee.org>
Thu, 24 Aug 2023 16:33:26 +0000 (12:33 -0400)
src/shared/tpm2-util.h

index 6883975174ae783c2d243b48f1b9d55753da5f1b..e62a3c30e12fcacf355b0ce2e10e42d1212c5b8d 100644 (file)
@@ -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);                                   \
         })