From 8571902e238ba2ef1517185c2a662c03f51dc1bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Noack?= Date: Thu, 1 May 2014 13:33:11 +0200 Subject: [PATCH] Avoid out-of-bounds write in SSL_get_shared_ciphers PR: 3317 --- ssl/ssl_lib.c | 3 +++ 1 file changed, 3 insertions(+) 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