From 1f5bce2dcebbb5059c2a5ecf4037432e8041cc07 Mon Sep 17 00:00:00 2001 From: Kurt Roeckx Date: Mon, 12 May 2014 18:19:14 +0200 Subject: [PATCH] Check sk_SSL_CIPHER_num() after assigning sk. --- ssl/ssl_lib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 0a7e2aad2d..00b26ba429 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -1467,11 +1467,12 @@ char *SSL_get_shared_ciphers(const SSL *s,char *buf,int len) (len < 2)) return(NULL); + p=buf; + sk=s->session->ciphers; + if (sk_SSL_CIPHER_num(sk) == 0) return NULL; - p=buf; - sk=s->session->ciphers; for (i=0; i