Skip to content

Coverity 2025 #3438

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Coverity 2025 #3438

wants to merge 3 commits into from

Conversation

Jakuje
Copy link
Member

@Jakuje Jakuje commented Jun 5, 2025

Fix recent coverity reports.

Checklist
  • Documentation is added or updated
  • New files have a LGPL 2.1 license statement
  • PKCS#11 module is tested
  • Windows minidriver is tested
  • macOS token is tested

When negative value is returned from sc_asn1_put_tag(), it is first assigned to
`sbuflen`, which is unsigned, truncating the negative numbers.
Only after that assigned to the `r`, causing it can't be negative, effectively
hiding possible errors from the above function.

Thanks coverity (CID 468028)

Signed-off-by: Jakub Jelen <[email protected]>
@Jakuje
Copy link
Member Author

Jakuje commented Jun 5, 2025

Sounds like the coolkey change will need some more love. I finally found a working coolkey card and this version is crashing.

Jakuje added 2 commits June 5, 2025 16:08
The certificate is read from the CKA_VALUE, which is allocated in `data` field of
`sc_pkcs15_der` structure of the `sc_pkcs15_cert_info`. This is processed, but
never cleaned up.

Thanks coverity (CID 454833, CID 454822)

Signed-off-by: Jakub Jelen <[email protected]>
Thanks coverity (CID 13754)

Signed-off-by: Jakub Jelen <[email protected]>
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