Index: crypto/openssl/ssl/ssl_lib.c =================================================================== RCS file: /home/ncvs/src/crypto/openssl/ssl/ssl_lib.c,v retrieving revision 1.1.1.12.2.1 diff -u -d -r1.1.1.12.2.1 ssl_lib.c --- crypto/openssl/ssl/ssl_lib.c 28 Sep 2006 13:02:36 -0000 1.1.1.12.2.1 +++ crypto/openssl/ssl/ssl_lib.c 3 Oct 2007 17:01:24 -0000 @@ -1149,7 +1149,6 @@ char *SSL_get_shared_ciphers(SSL *s,char *buf,int len) { char *p; - const char *cp; STACK_OF(SSL_CIPHER) *sk; SSL_CIPHER *c; int i; @@ -1162,20 +1161,21 @@ sk=s->session->ciphers; for (i=0; iname; *cp; ) + n=strlen(c->name); + if (n+1 > len) { - if (len-- <= 0) - { - *p='\0'; - return(buf); - } - else - *(p++)= *(cp++); + if (p != buf) + --p; + *p='\0'; + return buf; } + strcpy(p,c->name); + p+=n; *(p++)=':'; + len-=n+1; } p[-1]='\0'; return(buf);