-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix for parsing a certificate with an extension attribute with a NULL-value #39
base: master
Are you sure you want to change the base?
Conversation
…at would break processing the rest of the certificate.
BIO_free(ext_bio); | ||
if (bptr->data == NULL){ | ||
BIO_free(ext_bio); | ||
data=""; |
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.
free(data)
:)
By the way, please follow the coding style at first. |
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.
With the lack of activity in this PR, I'm starting to believe this was a case of a certificate being malformed or some other factor than this specific module and was solved by correcting that issue.
If we do decide to make this change, I would use the reverse logic and only allocate/copy/trim if bptr->data != NULL
. I'm pretty sure that's what @yorkie was eluding to with https://github.com/Southern/node-x509/pull/39/files#r75600803.
|
||
BIO_free(ext_bio); | ||
if (bptr->data == NULL){ |
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.
Seems like the better option would be to not run the allocation or anything that deals with data unless bptr->data != NULL
.
This pull request should resolve #37 by checking if a extension contains NULL data. When implemented, the extension is still given as output, but with an empty value (\0).