summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_lib.c
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:57:14 +0100
commit15c1ac03c8d23362940ce2809925598497098eae (patch)
treeb5891df54131707f009c022a276a34b4dcbbaeb9 /ssl/ssl_lib.c
parentc3c6fc7855816d8a9866a2033dd6bf7ed6a3a9af (diff)
Avoid out-of-bounds write in SSL_get_shared_ciphers
PR: 3317
Diffstat (limited to 'ssl/ssl_lib.c')
-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 6dbc3c1f7d..6e2711afa6 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1347,6 +1347,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++)