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
PKCS12_SAFEBAG_set0_attrs: Remove const from function signature #19359
Conversation
crypto/pkcs12/p12_attr.c
Outdated
@@ -125,5 +125,5 @@ void PKCS12_SAFEBAG_set0_attrs(PKCS12_SAFEBAG *bag, const STACK_OF(X509_ATTRIBUT | |||
if (bag->attrib != attrs) | |||
sk_X509_ATTRIBUTE_free(bag->attrib); | |||
|
|||
bag->attrib = (STACK_OF(X509_ATTRIBUTE*))attrs; | |||
bag->attrib = (STACK_OF(X509_ATTRIBUTE) *)attrs; |
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.
Hmmm. - this function doesn't quite look right. The cast is only necessary here because we are casting away the "const". But it probably should not be const at all, because we eventually plan to "free" this value. So I think the correct fix here is to remove the cast altogether and adjust the function signature to remove "const". This is ok because this function is newly added to master and doesn't exist in other branches - so backwards compatibility is not a concern.
This pull request is ready to merge |
Merged to master. Thank you. |
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from #19359)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from #19359)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from openssl#19359)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from openssl#19359)
Checklist