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

FAPI: fix problems detected by scanner. #2906

Merged

Conversation

JuergenReppSIT
Copy link
Member

@JuergenReppSIT JuergenReppSIT commented Oct 20, 2024

  • Fix missing check of scanf result.
  • Fix storing of local variable stored in non-local memory.
  • MU: Remove unneeded cast in TPM2B_UNMARSHAL.

In several cases the return value of scanf was not checked.
Thus afterwards acces to variables not initialized was possible.

Signed-off-by: Juergen Repp <juergen_repp@web.de>
The corresponding local array is now created with malloc and
freed after the execution of Fapi_WriteAuthorizeNv_Finish.

Signed-off-by: Juergen Repp <juergen_repp@web.de>
@JuergenReppSIT JuergenReppSIT force-pushed the fapi-fix-scanner-errors branch from 8ba41f7 to 41b94ad Compare October 31, 2024 14:41
@JuergenReppSIT JuergenReppSIT marked this pull request as ready for review October 31, 2024 16:11
An uneeded cast was removed, because the name of the used buffer
was passed to TPM2B_UNMARSHAL and could be used.

Signed-off-by: Juergen Repp <juergen_repp@web.de>
@AndreasFuchsTPM AndreasFuchsTPM merged commit 58aa671 into tpm2-software:master Dec 4, 2024
25 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.

2 participants