summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorGünther Noack <gnoack@google.com>2014-05-01 13:33:11 +0200
committerMatt Caswell <matt@openssl.org>2014-05-11 23:55:06 +0100
commit8571902e238ba2ef1517185c2a662c03f51dc1bf (patch)
tree87cce671c97ac17c00e905379406fd5706f2d9a0 /ssl
parent711bb9bc88f0da7c2a13eb71c1925f3d32fd77ed (diff)
Avoid out-of-bounds write in SSL_get_shared_ciphers
PR: 3317
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_lib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 0103296aa9..0a7e2aad2d 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1467,6 +1467,9 @@ char *SSL_get_shared_ciphers(const SSL *s,char *buf,int len)
(len < 2))
return(NULL);
+ if (sk_SSL_CIPHER_num(sk) == 0)
+ return NULL;
+
p=buf;
sk=s->session->ciphers;
for (i=0; i<sk_SSL_CIPHER_num(sk); i++)