aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2014-05-12 18:19:14 +0200
committerMatt Caswell <matt@openssl.org>2014-05-12 22:56:13 +0100
commit4ee356686f72ff849f6f3d58562224ace732b1a6 (patch)
treec132617c96057144499408cc5a2c6326db4c8e42
parenta4a442cccf45d9563b4266164bf8cfc9e24086ce (diff)
downloadopenssl-4ee356686f72ff849f6f3d58562224ace732b1a6.tar.gz
Check sk_SSL_CIPHER_num() after assigning sk.
-rw-r--r--ssl/ssl_lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 047f69aeed..4720680769 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1457,11 +1457,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<sk_SSL_CIPHER_num(sk); i++)
{
int n;