tpm12: Replace strcpy with safer strncpy

Replace the strcpy with the safer strncpy version.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2019-12-16 19:29:26 -05:00 committed by Stefan Berger
parent f289817a61
commit 75a2cd1a78

View File

@ -135,7 +135,7 @@ TPM_RESULT TPM_NVRAM_Init(void)
}
}
if (rc == 0) {
strcpy(state_directory, tpm_state_path);
strncpy(state_directory, tpm_state_path, sizeof(state_directory));
printf("TPM_NVRAM_Init: Rooted state path %s\n", state_directory);
}
return rc;