diff --git a/src/tss2-mu/tpm2b-types.c b/src/tss2-mu/tpm2b-types.c index 6d55fb360..969a4cba6 100644 --- a/src/tss2-mu/tpm2b-types.c +++ b/src/tss2-mu/tpm2b-types.c @@ -147,7 +147,7 @@ TSS2_RC Tss2_MU_##type##_Unmarshal(uint8_t const buffer[], size_t buffer_size, \ \ if (dest != NULL) { \ dest->size = size; \ - memcpy(((TPM2B *)dest)->buffer, &buffer[local_offset], size); \ + memcpy(&dest->buf_name, &buffer[local_offset], size); \ } \ local_offset += size; \ if (offset != NULL) { \