summaryrefslogtreecommitdiffstats
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:07:44 +0100
commita2c00fb2101b5704aa348fae8edeeecca833aefc (patch)
tree2e53c054dc467da6b4e45a693a3a6930be762a09
parentd06ae0fff7635bd914b2c3996f93680a13064976 (diff)
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 adb32351ca..47a0c7c4ea 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1256,11 +1256,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;