mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-13 04:16:03 +00:00
tpm2: Initialize variable reported by Coverity (false positive)
Initialize a variable in ExecuteCommand following Coverity report CID 1461252. Down the callpath as reported in CID 1461252 in TPMI_ST_COMMAND_TAG_Unmarshal() the passed-in value of TPMI_ST_COMMAND_TAG *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. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
fbf413ec86
commit
5bc860ac37
@ -148,6 +148,7 @@ ExecuteCommand(
|
||||
if(g_DRTMHandle != TPM_RH_UNASSIGNED)
|
||||
ObjectTerminateEvent();
|
||||
// Get command buffer size and command buffer.
|
||||
command.tag = 0; // libtpms added: Coverity
|
||||
command.parameterBuffer = request;
|
||||
command.parameterSize = requestSize;
|
||||
// Parse command header: tag, commandSize and command.code.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user