func: static void *CVE_2011_1175_VULN_handle_tcptls_connection(void *data) struct ast_tcptls_session_instance * tcptls_session = data ; int ( * ssl_setup ) ( SSL * ) = ( tcptls_session -> client ) ? SSL_connect : SSL_accept int ret ; if ( ! tcptls_session -> parent -> tls_cfg )  if ( tcptls_session -> ssl = SSL_new ( tcptls_session -> parent -> tls_cfg -> ssl_ctx ) )  if ( ( ret = ssl_setup ( tcptls_session -> ssl ) ) <= 0 )  tcptls_session -> f = funopen ( tcptls_session -> ssl , ssl_read , ssl_write , NULL , ssl_close ); if ( ( tcptls_session -> client && ! ast_test_flag ( & tcptls_session -> parent -> tls_cfg -> flags , AST_SSL_DONT_VERIFY_SERVER ) ) || ( ! tcptls_session -> client && ast_test_flag ( & tcptls_session -> parent -> tls_cfg -> flags , AST_SSL_VERIFY_CLIENT ) ) )  X509 * peer ; peer = SSL_get_peer_certificate ( tcptls_session -> ssl ); if ( ! ast_test_flag ( & tcptls_session -> parent -> tls_cfg -> flags , AST_SSL_IGNORE_COMMON_NAME ) )  unsigned char * str2 ; X509_NAME * name = X509_get_subject_name ( peer ) ; int pos = - 1 ; int found = 0 ; pos = X509_NAME_get_index_by_NID ( name , NID_commonName , pos ); if ( pos < 0 )  if ( str2 )  if ( ! strcasecmp ( tcptls_session -> parent -> hostname , ( char * ) str2 ) )  found = 1; if ( found )  if ( ! found )  fclose ( tcptls_session -> f ); 