summaryrefslogtreecommitdiffstats
path: root/crypto/x509
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-04-28 13:09:27 +0100
committerDr. Stephen Henson <steve@openssl.org>2016-04-29 19:42:21 +0100
commitb33d1141b6dcce947708b984c5e9e91dad3d675d (patch)
tree34e60a84a133d138b0695c0b5d02a860413d8f19 /crypto/x509
parent295f3a24919157e2f9021d0b1709353710ad63db (diff)
Sanity check buffer length.
Reject zero length buffers passed to X509_NAME_onelne(). Issue reported by Guido Vranken. Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/x509')
-rw-r--r--crypto/x509/x509_obj.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/x509/x509_obj.c b/crypto/x509/x509_obj.c
index ac871b4029..920828373c 100644
--- a/crypto/x509/x509_obj.c
+++ b/crypto/x509/x509_obj.c
@@ -86,6 +86,8 @@ char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
goto err;
b->data[0] = '\0';
len = 200;
+ } else if (len == 0) {
+ return NULL;
}
if (a == NULL) {
if (b) {