summaryrefslogtreecommitdiff
path: root/crypto/x509/t_req.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2019-09-10 17:40:53 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2019-09-10 17:40:53 +0000
commitfbc3ad1ae1976eb5f2bac351260f2c5ee255c27f (patch)
tree47b0480872069bf4f86022494c02f03c8064090d /crypto/x509/t_req.c
parent55cff0339bb965074f300ecedc3f153ffb3e0fd3 (diff)
Notes
Diffstat (limited to 'crypto/x509/t_req.c')
-rw-r--r--crypto/x509/t_req.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/x509/t_req.c b/crypto/x509/t_req.c
index 2d4c591b74458..dc3b4f262de90 100644
--- a/crypto/x509/t_req.c
+++ b/crypto/x509/t_req.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -127,6 +127,10 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags,
if ((j = i2a_ASN1_OBJECT(bp, aobj)) > 0) {
ii = 0;
count = X509_ATTRIBUTE_count(a);
+ if (count == 0) {
+ X509err(X509_F_X509_REQ_PRINT_EX, X509_R_INVALID_ATTRIBUTES);
+ return 0;
+ }
get_next:
at = X509_ATTRIBUTE_get0_type(a, ii);
type = at->type;