Skip to content

Add missing NULL check in openssl#530

Open
icy17 wants to merge 1 commit intoravynsoft:mainfrom
icy17:add_missing_check_openssl
Open

Add missing NULL check in openssl#530
icy17 wants to merge 1 commit intoravynsoft:mainfrom
icy17:add_missing_check_openssl

Conversation

@icy17
Copy link
Contributor

@icy17 icy17 commented Oct 31, 2025

No description provided.

Comment on lines -32 to +36
X509_CRL_print(bio, crl);
BIO_free(bio);

if (bio != NULL) {
X509_CRL_print(bio, crl);
BIO_free(bio);
}

Choose a reason for hiding this comment

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

Can't valid ASN1 encode NULL values in CRL (as already checked for on line 30) meaning in the case bio == NULL we actually want to 'CRL_print' an odd but valid NULL representation (like \0 for echo -e) ... I'd expect the crl ASN1 length to be more indicative of whether there is a "NULL" value here or and odd but valid value, especially after the crl passed the check of != NULL indicating at-least a tag and length are present to parse (even if e.g., T<crl>:0:<NULL> the NULL content should not be considered part of the CRL value as the length is 0) thus I'd expect a zero-length check before a null-value check. Am I just missing something? If so, what am I missing here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Although it's technically legal to encode a NULL, why would a NULL make sense in a certificate revocation list? It doesn't mean anything since it doesn't name any revoked certificates. I think handling this as an error in the CRL is OK.

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.

3 participants