Skip to content

Commit

Permalink
tpm2: Add an assert(profileJSON) since it must never be NULL
Browse files Browse the repository at this point in the history
When profileJSON is passed to String_Marshal it must never be NULL.

Signed-off-by: Stefan Berger <[email protected]>
  • Loading branch information
stefanberger committed Sep 24, 2024
1 parent ab3da80 commit 6adb99a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/tpm2/NVMarshal.c
Original file line number Diff line number Diff line change
Expand Up @@ -5109,6 +5109,7 @@ PERSISTENT_ALL_Marshal(BYTE **buffer, INT32 *size)
PERSISTENT_ALL_MAGIC, blob_version);
if (blob_version >= 4) {
profileJSON = RuntimeProfileGetJSON(RuntimeProfile);
assert(profileJSON);
written += String_Marshal(profileJSON, buffer, size); // since v4
}
written += PACompileConstants_Marshal(buffer, size);
Expand Down

0 comments on commit 6adb99a

Please sign in to comment.