summaryrefslogtreecommitdiffstats
path: root/ssl
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 23:01:06 +0100
commit69526a354dd8909035bcb505ccfb52a93b37c30c (patch)
tree5cca194fcbaf46ff7ed13e55a5c3a7f2491133f6 /ssl
parent778f2b648c3f4017b5ef102983a769f075959a86 (diff)
Check sk_SSL_CIPHER_num() after assigning sk.
Diffstat (limited to 'ssl')
-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 6e2711afa6..ef6258ca9f 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1347,11 +1347,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;