summaryrefslogtreecommitdiff
path: root/crypto/x509/x509_req.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2022-08-01 15:06:35 +0200
committerDr. David von Oheimb <dev@ddvo.net>2022-08-24 11:24:24 +0200
commite128eaa094fc0e95c93081c914c85bd6962a9a42 (patch)
treed9dd4c59a9b18e13dcb5ea2dad4206d554741457 /crypto/x509/x509_req.c
parentbf16ee4f95c31a66e76056c691f25a0d2b4a39c4 (diff)
downloadopenssl-new-e128eaa094fc0e95c93081c914c85bd6962a9a42.tar.gz
X509_REQ_get_extensions: add error queue entry on ill-formed extensions attribute
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/18931)
Diffstat (limited to 'crypto/x509/x509_req.c')
-rw-r--r--crypto/x509/x509_req.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c
index e3f5c2add1..9e926fbe29 100644
--- a/crypto/x509/x509_req.c
+++ b/crypto/x509/x509_req.c
@@ -154,8 +154,10 @@ STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req)
}
if (ext == NULL) /* no extensions is not an error */
return sk_X509_EXTENSION_new_null();
- if (ext->type != V_ASN1_SEQUENCE)
+ if (ext->type != V_ASN1_SEQUENCE) {
+ ERR_raise(ERR_LIB_X509, X509_R_WRONG_TYPE);
return NULL;
+ }
p = ext->value.sequence->data;
return (STACK_OF(X509_EXTENSION) *)
ASN1_item_d2i(NULL, &p, ext->value.sequence->length,