-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Fixes #20145: free memory of certStatus before goto err #20406
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
Conversation
@@ -817,8 +817,13 @@ OSSL_CMP_MSG *ossl_cmp_certConf_new(OSSL_CMP_CTX *ctx, int fail_info, | |||
if ((certStatus = OSSL_CMP_CERTSTATUS_new()) == NULL) | |||
goto err; | |||
/* consume certStatus into msg right away so it gets deallocated with msg */ | |||
if (!sk_OSSL_CMP_CERTSTATUS_push(msg->body->value.certConf, certStatus)) | |||
if (sk_OSSL_CMP_CERTSTATUS_push(msg->body->value.certConf, certStatus) < 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DDvO What frees this stack in the normal case when this passes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As usual with ASN.1 structures, on success ownership of field contents is passed to the containing structure, so the (stack of) OSSL_CMP_CERTSTATUS
will be freed along with the msg
containing it.
I even tried to make this (rather) explicit here by the comment above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just remove the needless comment,
and apart from this the two fixes done here here are good.
Can we assert CLA: trivial, |
As these fixes should be done for all versions since 3.0, I added the respective labels. |
Can somebody explain to me why suddenly
? So far I had assumed that this label has to do mainly with API (public header file) changes. |
Maybe the script is confused by the merge commits in this PR??? |
Good hint - with the but-last push, which did not actually change the actual PR contents |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine, assuming the CLA topic will be sorted out before merging.
Please drop the merge commits by |
I would be OK with CLA: trivial for this. |
In one of the CI runs, unix-macos11-m1, one of the test cases in |
Do we need more people to agree here, or who is entitled to remove the hold: cla required? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK with CLA: trivial
All reviewers and the author must agree that a contribution is trivial and then a committer is allowed to lift it. |
@mhjd do you agree that the contribution is simple enough for not having to submit a CLA? |
I agree, it's trivial, no need to submit a CLA 👌 |
@mhjd Could you please use |
24 hours has passed since 'approval: done' was set, but as this PR has been updated in that time the label 'approval: ready to merge' is not being automatically set. Please review the updates and set the label manually. |
I wait the help of my professor, I have some problem with git rebase because it drop too many commits. Nevertheless I plan to retry when I have time, tomorrow or Saturday. |
I doubt this PR can really be merged in the current state, given the merge commits included. |
Sorry for the delay, I intend to try to solve it today. (There's been a strike problem for the last few weeks so I can't ask my teacher for help). |
We can resolve the problem when merging. |
CLA: trivial Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from #20406)
Merged to master, 3.1, and 3.0 branches after squashing the commits. Thank you for your contribution. |
I have fix the issue #20145 with freeing memory of certStatus and changed the condition as asked in the issue.
I changed :
Into :