Skip to content

Commit

Permalink
Auth file: Ensure 0-termination
Browse files Browse the repository at this point in the history
When reading auths from a file, make sure they are 0-terminated.

Signed-off-by: Andreas Fuchs <[email protected]>
  • Loading branch information
AndreasFuchsTPM committed Jan 31, 2024
1 parent 8d24dfa commit eba7a72
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/tpm2_auth_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ static tool_rc get_auth_for_file_param(const char* password, TPM2B_AUTH *auth) {
free(buffer);
return tool_rc_general_error;
}
buffer[fsize] = '\0';
size = fsize;

} else {
Expand Down

0 comments on commit eba7a72

Please sign in to comment.