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 for parsing a certificate with an extension attribute with a NULL-value #39

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

Conversation

mwpnl
Copy link

@mwpnl mwpnl commented Aug 21, 2016

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).

mwpnl added 2 commits August 21, 2016 15:28
…at would break processing the rest of the certificate.
BIO_free(ext_bio);
if (bptr->data == NULL){
BIO_free(ext_bio);
data="";
Copy link
Collaborator

Choose a reason for hiding this comment

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

free(data) :)

@yorkie
Copy link
Collaborator

yorkie commented Aug 21, 2016

By the way, please follow the coding style at first.

@Southern
Copy link
Owner

@mwpnl Should @yorkie or I make the changes that were suggested so that this can be merged in? Been a little over 2 weeks with no response.

Copy link
Owner

@Southern Southern left a 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){
Copy link
Owner

@Southern Southern Oct 3, 2016

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.

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.

SegFault on certain certificates
3 participants