Skip to content

Commit

Permalink
FAPI: fix memset 0 in ifapi_json_TPMS_POLICYNV_deserialize.
Browse files Browse the repository at this point in the history
The wrong size was used to clear the memory if the field was not found.

Signed-off-by: Juergen Repp <[email protected]>
  • Loading branch information
JuergenReppSIT committed Feb 22, 2024
1 parent 860787d commit 7d44377
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tss2-fapi/ifapi_policy_json_deserialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ ifapi_json_TPMS_POLICYNV_deserialize(json_object *jso, TPMS_POLICYNV *out)
}

if (!ifapi_get_sub_object(jso, "nvPublic", &jso2)) {
memset(&out->nvPublic, 0, sizeof(TPM2B_NV_PUBLIC));
memset(&out->nvPublic, 0, sizeof(TPMS_NV_PUBLIC));
} else {
TPM2B_NV_PUBLIC tmp = { 0 };
r = ifapi_json_TPM2B_NV_PUBLIC_deserialize(jso2, &tmp);
Expand Down

0 comments on commit 7d44377

Please sign in to comment.