mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-11 21:50:09 +00:00
tpm12: coverity: Use length + 1 for strncpy() parameter
Use length + 1 as size parameter to strncpy() to address a Coverity issue (false positive). Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
6c0144be4b
commit
d186b753c8
@ -135,7 +135,7 @@ TPM_RESULT TPM_NVRAM_Init(void)
|
||||
}
|
||||
}
|
||||
if (rc == 0) {
|
||||
strncpy(state_directory, tpm_state_path, sizeof(state_directory));
|
||||
strncpy(state_directory, tpm_state_path, length + 1);
|
||||
printf("TPM_NVRAM_Init: Rooted state path %s\n", state_directory);
|
||||
}
|
||||
return rc;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user