Check s3 is not NULL

This commit is contained in:
Dr. Stephen Henson 2009-12-09 14:53:51 +00:00
parent aac751832a
commit b41a614686

View File

@ -1394,7 +1394,7 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num,
const SSL_CIPHER *c; const SSL_CIPHER *c;
STACK_OF(SSL_CIPHER) *sk; STACK_OF(SSL_CIPHER) *sk;
int i,n; int i,n;
if (s->s3)
s->s3->send_connection_binding = 0; s->s3->send_connection_binding = 0;
n=ssl_put_cipher_by_char(s,NULL,NULL); n=ssl_put_cipher_by_char(s,NULL,NULL);
@ -1414,7 +1414,7 @@ STACK_OF(SSL_CIPHER) *ssl_bytes_to_cipher_list(SSL *s,unsigned char *p,int num,
for (i=0; i<num; i+=n) for (i=0; i<num; i+=n)
{ {
/* Check for MCSV */ /* Check for MCSV */
if ((n != 3 || !p[0]) && if (s->s3 && (n != 3 || !p[0]) &&
(p[n-2] == ((SSL3_CK_MCSV >> 8) & 0xff)) && (p[n-2] == ((SSL3_CK_MCSV >> 8) & 0xff)) &&
(p[n-1] == (SSL3_CK_MCSV & 0xff))) (p[n-1] == (SSL3_CK_MCSV & 0xff)))
{ {