diff --git a/src/tss2-fapi/fapi_util.c b/src/tss2-fapi/fapi_util.c index 83ccc1342..1bb294d3d 100644 --- a/src/tss2-fapi/fapi_util.c +++ b/src/tss2-fapi/fapi_util.c @@ -441,6 +441,10 @@ ifapi_set_auth( return_if_error(r, "policyAuthCallback"); if (auth != NULL) { authValue.size = strlen(auth); + if (authValue.size > sizeof(TPMU_HA)) { + return_error2(TSS2_FAPI_RC_BAD_VALUE, "Auth value %u > %lu", + authValue.size, sizeof(TPMU_HA)); + } memcpy(&authValue.buffer[0], auth, authValue.size); }