OpenSSL CVS Repository
http://cvs.openssl.org/
____________________________________________________________
________________
Server: cvs.openssl.org Name: Ben
Laurie
Root: /v/openssl/cvs Email: ben openssl.org
Module: openssl Date:
04-Oct-2007 10:01:21
Branch: OpenSSL_0_9_7-stable Handle:
2007100409012100
Modified files: (Branch: OpenSSL_0_9_7-stable)
openssl/ssl ssl_lib.c
Log:
Fix off-by-one.
Summary:
Revision Changes Path
1.110.2.20 +11 -11 openssl/ssl/ssl_lib.c
____________________________________________________________
________________
patch -p0 <<' .'
Index: openssl/ssl/ssl_lib.c
============================================================
================
$ cvs diff -u -r1.110.2.19 -r1.110.2.20 ssl_lib.c
--- openssl/ssl/ssl_lib.c 28 Sep 2006 11:53:51
-0000 1.110.2.19
+++ openssl/ssl/ssl_lib.c 4 Oct 2007 08:01:21
-0000 1.110.2.20
 -1169,7 +1169,6 
char *SSL_get_shared_ciphers(const SSL *s,char *buf,int
len)
{
char *p;
- const char *cp;
STACK_OF(SSL_CIPHER) *sk;
SSL_CIPHER *c;
int i;
 -1182,20 +1181,21 
sk=s->session->ciphers;
for (i=0; i<sk_SSL_CIPHER_num(sk); i++)
{
- /* Decrement for either the ':' or a ' ' */
- len--;
+ int n;
+
c=sk_SSL_CIPHER_value(sk,i);
- for (cp=c->name; *cp; )
+ n=strlen(c->name);
+ if (n+1 > len)
{
- if (len-- <= 0)
- {
- *p=' ';
- return(buf);
- }
- else
- *(p++)= *(cp++);
+ if (p != buf)
+ --p;
+ *p=' ';
+ return buf;
}
+ strcpy(p,c->name);
+ p+=n;
*(p++)=':';
+ len-=n+1;
}
p[-1]=' ';
return(buf);
 .
____________________________________________________________
__________
OpenSSL Project http://www.openssl.org
CVS Repository Commit List
openssl-cvs openssl.org
Automated List Manager
majordomo openssl.org
|