Browse Source

X509_REQ_get_extensions(): Return empty stack if no extensions found

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13841)
master
Dr. David von Oheimb 1 year ago
committed by Dr. David von Oheimb
parent
commit
2039ac07b4
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      crypto/x509/x509_req.c

+ 3
- 1
crypto/x509/x509_req.c View File

@ -152,7 +152,9 @@ STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req)
ext = X509_ATTRIBUTE_get0_type(attr, 0);
break;
}
if (!ext || (ext->type != V_ASN1_SEQUENCE))
if (ext == NULL) /* no extensions is not an error */
return sk_X509_EXTENSION_new_null();
if (ext->type != V_ASN1_SEQUENCE)
return NULL;
p = ext->value.sequence->data;
return (STACK_OF(X509_EXTENSION) *)


Loading…
Cancel
Save