Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverity scan #2782

Merged
Merged

Conversation

JuergenReppSIT
Copy link
Member

for coverity

Dead code is removed in Esys_NV_ChangeAuth.c and Esys_ObjectChangeAuth.c

Signed-off-by: Juergen Repp <[email protected]>
Duplicate statement is removed.

Signed-off-by: Juergen Repp <[email protected]>
If and error does occur in the openssl crypto functions
the context is not freed.

Signed-off-by: Juergen Repp <[email protected]>
The size of the size field was added to the buffer size.

Signed-off-by: Juergen Repp <[email protected]>
The crypto context is now freed in error cases.

Signed-off-by: Juergen Repp <[email protected]>
A fallthrough after a return is removed.

Signed-off-by: Juergen Repp <[email protected]>
In an error case the variables public, name, and qualifiedName were
not freed.

Signed-off-by: Juergen Repp <[email protected]>
A return value was not assigned but checked afterwards.

Signed-off-by: Juergen Repp <[email protected]>
A falltrhough which can't be reached is removed.

Signed-off-by: Juergen Repp <[email protected]>
The possible return value -1 is now checked.

Signed-off-by: Juergen Repp <[email protected]>
The variable int_ca_file was used after return_try_again.
Now the value of the corresponding environment variable is used.

Signed-off-by: Juergen Repp <[email protected]>
As destination field now sha512 instead of sha1 is used.

Signed-off-by: Juergen Repp <[email protected]>
Returns were exchanged with goto error.

Signed-off-by: Juergen Repp <[email protected]>
It's now checked whether the complete ima header is read.

Signed-off-by: Juergen Repp <[email protected]>
The function file_to_buffer did not close fp in error cases.

Signed-off-by: Juergen Repp <[email protected]>
The wrong size was used to clear the memory if the field was not found.

Signed-off-by: Juergen Repp <[email protected]>
The IMA parser did not check the length field for the ima type.

Signed-off-by: Juergen Repp <[email protected]>
Ther was no else case in the receive function when the header
was not received but afterwards the partial_size was unmarshalled
from header. Now TSS2_TCTI_RC_GENERAL_FAILURE is returned in
this case.

Signed-off-by: Juergen Repp <[email protected]>
The return code of the authorization function for a signing key was not
checked.

Signed-off-by: Juergen Repp <[email protected]>
The wrong size variable was used to check the out of bound access.

Signed-off-by: Juergen Repp <[email protected]>
* In the cleanup function for an ossl hash context the variables
  were not checked before calling the ossl cleanup functions.
* An unneded cast was removed.

Signed-off-by: Juergen Repp <[email protected]>
@JuergenReppSIT JuergenReppSIT merged commit c09666d into tpm2-software:coverity_scan Feb 27, 2024
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant