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

Fix error handling on strdup #3008

Merged
merged 2 commits into from
Feb 1, 2024
Merged

Conversation

frankmorgner
Copy link
Member

I have reviewed all issues that were brought up by CodeQL. Unfortunately, almost everyone of them was a false positive. It seems that CodeQL doesn't understand it when we're correctly handling some error in the line of the following:

p = calloc(5);
if (p == NULL)
   LOG_FUNC_RETURN(card->ctx, SC_ERROR_OUT_OF_MEMORY);

Anyway, one CodeQL issue at least led me to harden some other error handling around the referenced code.

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 tokend is tested

Copy link
Member

@Jakuje Jakuje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise lgtm

src/pkcs15init/pkcs15-lib.c Outdated Show resolved Hide resolved
@frankmorgner frankmorgner merged commit 5c6ee99 into OpenSC:master Feb 1, 2024
40 of 43 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.

None yet

2 participants