Fix for parsing a certificate with an extension attribute with a NULL-value#39
Open
mwpnl wants to merge 2 commits intoSouthern:masterfrom
Open
Fix for parsing a certificate with an extension attribute with a NULL-value#39mwpnl wants to merge 2 commits intoSouthern:masterfrom
mwpnl wants to merge 2 commits intoSouthern:masterfrom
Conversation
…at would break processing the rest of the certificate.
| BIO_free(ext_bio); | ||
| if (bptr->data == NULL){ | ||
| BIO_free(ext_bio); | ||
| data=""; |
Collaborator
|
By the way, please follow the coding style at first. |
Owner
Southern
requested changes
Oct 3, 2016
Owner
Southern
left a comment
There was a problem hiding this comment.
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.
| data = trim(data, bptr->length); | ||
|
|
||
| BIO_free(ext_bio); | ||
| if (bptr->data == NULL){ |
Owner
There was a problem hiding this comment.
Seems like the better option would be to not run the allocation or anything that deals with data unless bptr->data != NULL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).