diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-04-28 13:09:27 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-04-29 19:46:09 +0100 |
commit | 66e731ab09f2c652d0e179df3df10d069b407604 (patch) | |
tree | 967c99f338802ce9561f7476e6f171dc07314773 | |
parent | 65cb92f4da37a3895437f0c9940ee0bcf9f28c8a (diff) | |
download | openssl-new-66e731ab09f2c652d0e179df3df10d069b407604.tar.gz |
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>
(cherry picked from commit b33d1141b6dcce947708b984c5e9e91dad3d675d)
-rw-r--r-- | crypto/x509/x509_obj.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/x509/x509_obj.c b/crypto/x509/x509_obj.c index d317f3af25..500c9dfa54 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) { |