mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-08 05:26:43 +00:00
tpm2: Initialize variable reported by Coverity (false positive)
Initialize a variable in TPM2_PolicyAuthorizeNV() following Coverity report CID 1470811. Down the callpath as reported in CID 1470811 in TPMI_ALG_HASH_Unmarshal() the passed-in value of TPMI_ALG_HASH *target is stored and possibly restored later on in case of failure. Coverity complains that the variable is uninitialized. While this is correct, there's no harm reading the uninitialized value from the structure and possibly restoring it later on while not doing anything else with it otherwise. Therefore, it's a false positive. Resolves: https://github.com/stefanberger/libtpms/issues/311 Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
ec873cf8a2
commit
fbf413ec86
@ -1116,7 +1116,9 @@ TPM2_PolicyAuthorizeNV(
|
||||
NV_REF locator;
|
||||
NV_INDEX *nvIndex = NvGetIndexInfo(in->nvIndex, &locator);
|
||||
TPM2B_NAME name;
|
||||
TPMT_HA policyInNv;
|
||||
TPMT_HA policyInNv = {
|
||||
.hashAlg = 0, // libpms added: Coverity
|
||||
};
|
||||
BYTE nvTemp[sizeof(TPMT_HA)];
|
||||
BYTE *buffer = nvTemp;
|
||||
INT32 size;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user