提交 838d25a1 编写于 作者: B Ben Laurie

More safe stack.

上级 5132cadf
...@@ -1025,7 +1025,7 @@ long SSL_get_default_timeout(SSL *s); ...@@ -1025,7 +1025,7 @@ long SSL_get_default_timeout(SSL *s);
int SSL_library_init(void ); int SSL_library_init(void );
char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size); char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size);
STACK *SSL_dup_CA_list(STACK *sk); STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk);
SSL *SSL_dup(SSL *ssl); SSL *SSL_dup(SSL *ssl);
......
...@@ -452,19 +452,19 @@ static void set_client_CA_list(STACK_OF(X509_NAME) **ca_list,STACK_OF(X509_NAME) ...@@ -452,19 +452,19 @@ static void set_client_CA_list(STACK_OF(X509_NAME) **ca_list,STACK_OF(X509_NAME)
*ca_list=list; *ca_list=list;
} }
STACK *SSL_dup_CA_list(STACK *sk) STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk)
{ {
int i; int i;
STACK *ret; STACK_OF(X509_NAME) *ret;
X509_NAME *name; X509_NAME *name;
ret=sk_new_null(); ret=sk_X509_NAME_new_null();
for (i=0; i<sk_num(sk); i++) for (i=0; i<sk_X509_NAME_num(sk); i++)
{ {
name=X509_NAME_dup((X509_NAME *)sk_value(sk,i)); name=X509_NAME_dup(sk_X509_NAME_value(sk,i));
if ((name == NULL) || !sk_push(ret,(char *)name)) if ((name == NULL) || !sk_X509_NAME_push(ret,name))
{ {
sk_pop_free(ret,X509_NAME_free); sk_X509_NAME_pop_free(ret,X509_NAME_free);
return(NULL); return(NULL);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册