Skip to content

Commit

Permalink
FAPI: Fix wrong format directive in ifap_set_auth
Browse files Browse the repository at this point in the history
%u was used for a 16 bit unsigned integer and %lu for sizeof.
Fixes: #2856

Signed-off-by: Juergen Repp <[email protected]>
  • Loading branch information
JuergenReppSIT authored and AndreasFuchsTPM committed Jul 2, 2024
1 parent ba2ea64 commit 4e2fe02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tss2-fapi/fapi_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ ifapi_set_auth(
if (auth != NULL) {
authValue.size = strlen(auth);
if (authValue.size > sizeof(TPMU_HA)) {
return_error2(TSS2_FAPI_RC_BAD_VALUE, "Size of auth value %u > %lu",
return_error2(TSS2_FAPI_RC_BAD_VALUE, "Size of auth value %"PRIu16" > %zu",
authValue.size, sizeof(TPMU_HA));
}
memcpy(&authValue.buffer[0], auth, authValue.size);
Expand Down

0 comments on commit 4e2fe02

Please sign in to comment.