apps/s_server.c:800: error: NULL_DEREFERENCE
  pointer `con` last assigned on line 785 could be null and is dereferenced by call to `SSL_set_bio()` at line 800, column 2.
Showing all 132 steps of the trace


apps/s_server.c:754:1: start of procedure sv_body()
752.   	}
753.   
754. > static int sv_body(char *hostname, int s, unsigned char *context)
755.   	{
756.   	char *buf=NULL;

apps/s_server.c:756:2: 
754.   static int sv_body(char *hostname, int s, unsigned char *context)
755.   	{
756. > 	char *buf=NULL;
757.   	fd_set readfds;
758.   	int ret=1,width;

apps/s_server.c:758:2: 
756.   	char *buf=NULL;
757.   	fd_set readfds;
758. > 	int ret=1,width;
759.   	int k,i;
760.   	unsigned long l;

apps/s_server.c:761:2: 
759.   	int k,i;
760.   	unsigned long l;
761. > 	SSL *con=NULL;
762.   	BIO *sbio;
763.   #ifdef WINDOWS

apps/s_server.c:767:6: 
765.   #endif
766.   
767. > 	if ((buf=Malloc(bufsize)) == NULL)
768.   		{
769.   		BIO_printf(bio_err,"out of memory\n");

crypto/mem.c:194:1: start of procedure CRYPTO_malloc()
  192.   	}
  193.   
  194. > void *CRYPTO_malloc(int num, const char *file, int line)
  195.   	{
  196.   	char *ret = NULL;

crypto/mem.c:196:2: 
  194.   void *CRYPTO_malloc(int num, const char *file, int line)
  195.   	{
  196. > 	char *ret = NULL;
  197.   
  198.   	allow_customize = 0;

crypto/mem.c:198:2: 
  196.   	char *ret = NULL;
  197.   
  198. > 	allow_customize = 0;
  199.   	if (malloc_debug_func != NULL)
  200.   		{

crypto/mem.c:199:6: Taking true branch
  197.   
  198.   	allow_customize = 0;
  199.   	if (malloc_debug_func != NULL)
              ^
  200.   		{
  201.   		allow_customize_debug = 0;

crypto/mem.c:201:3: 
  199.   	if (malloc_debug_func != NULL)
  200.   		{
  201. > 		allow_customize_debug = 0;
  202.   		malloc_debug_func(NULL, num, file, line, 0);
  203.   		}

crypto/mem.c:202:3: Skipping __function_pointer__(): unresolved function pointer
  200.   		{
  201.   		allow_customize_debug = 0;
  202.   		malloc_debug_func(NULL, num, file, line, 0);
           ^
  203.   		}
  204.   	ret = malloc_func(num);

crypto/mem.c:204:2: Skipping __function_pointer__(): unresolved function pointer
  202.   		malloc_debug_func(NULL, num, file, line, 0);
  203.   		}
  204.   	ret = malloc_func(num);
          ^
  205.   #ifdef LEVITTE_DEBUG
  206.   	fprintf(stderr, "LEVITTE_DEBUG:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:208:6: Taking true branch
  206.   	fprintf(stderr, "LEVITTE_DEBUG:         > 0x%p (%d)\n", ret, num);
  207.   #endif
  208.   	if (malloc_debug_func != NULL)
              ^
  209.   		malloc_debug_func(ret, num, file, line, 1);
  210.   

crypto/mem.c:209:3: Skipping __function_pointer__(): unresolved function pointer
  207.   #endif
  208.   	if (malloc_debug_func != NULL)
  209.   		malloc_debug_func(ret, num, file, line, 1);
           ^
  210.   
  211.   	return ret;

crypto/mem.c:211:2: 
  209.   		malloc_debug_func(ret, num, file, line, 1);
  210.   
  211. > 	return ret;
  212.   	}
  213.   

crypto/mem.c:212:2: return from a call to CRYPTO_malloc
  210.   
  211.   	return ret;
  212.   	}
          ^
  213.   
  214.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

apps/s_server.c:767:6: Taking false branch
765.   #endif
766.   
767.   	if ((buf=Malloc(bufsize)) == NULL)
            ^
768.   		{
769.   		BIO_printf(bio_err,"out of memory\n");

apps/s_server.c:773:6: Taking false branch
771.   		}
772.   #ifdef FIONBIO	
773.   	if (s_nbio)
            ^
774.   		{
775.   		unsigned long sl=1;

apps/s_server.c:784:6: Taking true branch
782.   #endif
783.   
784.   	if (con == NULL) {
            ^
785.   		con=(SSL *)SSL_new(ctx);
786.   		if(context)

apps/s_server.c:785:3: 
783.   
784.   	if (con == NULL) {
785. > 		con=(SSL *)SSL_new(ctx);
786.   		if(context)
787.   		      SSL_set_session_id_context(con, context,

ssl/ssl_lib.c:176:1: start of procedure SSL_new()
  174.   	}
  175.   
  176. > SSL *SSL_new(SSL_CTX *ctx)
  177.   	{
  178.   	SSL *s;

ssl/ssl_lib.c:180:6: Taking false branch
  178.   	SSL *s;
  179.   
  180.   	if (ctx == NULL)
              ^
  181.   		{
  182.   		SSLerr(SSL_F_SSL_NEW,SSL_R_NULL_SSL_CTX);

ssl/ssl_lib.c:185:6: Taking true branch
  183.   		return(NULL);
  184.   		}
  185.   	if (ctx->method == NULL)
              ^
  186.   		{
  187.   		SSLerr(SSL_F_SSL_NEW,SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);

ssl/ssl_lib.c:187:3: 
  185.   	if (ctx->method == NULL)
  186.   		{
  187. > 		SSLerr(SSL_F_SSL_NEW,SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
  188.   		return(NULL);
  189.   		}

crypto/err/err.c:246:1: start of procedure ERR_put_error()
    244.   /********************************************************/
    245.   
    246. > void ERR_put_error(int lib, int func, int reason, const char *file,
    247.   	     int line)
    248.   	{

crypto/err/err.c:270:2: Skipping ERR_get_state(): empty list of specs
    268.   	}
    269.   #endif
    270.   	es=ERR_get_state();
            ^
    271.   
    272.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:272:2: 
    270.   	es=ERR_get_state();
    271.   
    272. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    273.   	if (es->top == es->bottom)
    274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:273:6: Taking false branch
    271.   
    272.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    273.   	if (es->top == es->bottom)
                ^
    274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:275:2: 
    273.   	if (es->top == es->bottom)
    274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    275. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    276.   	es->err_file[es->top]=file;
    277.   	es->err_line[es->top]=line;

crypto/err/err.c:276:2: 
    274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    276. > 	es->err_file[es->top]=file;
    277.   	es->err_line[es->top]=line;
    278.   	err_clear_data(es,es->top);

crypto/err/err.c:277:2: 
    275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    276.   	es->err_file[es->top]=file;
    277. > 	es->err_line[es->top]=line;
    278.   	err_clear_data(es,es->top);
    279.   	}

crypto/err/err.c:278:2: Taking true branch
    276.   	es->err_file[es->top]=file;
    277.   	es->err_line[es->top]=line;
    278.   	err_clear_data(es,es->top);
            ^
    279.   	}
    280.   

crypto/err/err.c:278:2: Taking false branch
    276.   	es->err_file[es->top]=file;
    277.   	es->err_line[es->top]=line;
    278.   	err_clear_data(es,es->top);
            ^
    279.   	}
    280.   

crypto/err/err.c:279:2: return from a call to ERR_put_error
    277.   	es->err_line[es->top]=line;
    278.   	err_clear_data(es,es->top);
    279.   	}
            ^
    280.   
    281.   void ERR_clear_error(void)

ssl/ssl_lib.c:188:3: 
  186.   		{
  187.   		SSLerr(SSL_F_SSL_NEW,SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
  188. > 		return(NULL);
  189.   		}
  190.   

ssl/ssl_lib.c:251:2: return from a call to SSL_new
  249.   	SSLerr(SSL_F_SSL_NEW,ERR_R_MALLOC_FAILURE);
  250.   	return(NULL);
  251.   	}
          ^
  252.   
  253.   int SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx,

apps/s_server.c:786:6: Taking true branch
784.   	if (con == NULL) {
785.   		con=(SSL *)SSL_new(ctx);
786.   		if(context)
            ^
787.   		      SSL_set_session_id_context(con, context,
788.   						 strlen((char *)context));

apps/s_server.c:787:9: 
785.   		con=(SSL *)SSL_new(ctx);
786.   		if(context)
787. > 		      SSL_set_session_id_context(con, context,
788.   						 strlen((char *)context));
789.   	}

ssl/ssl_lib.c:267:1: start of procedure SSL_set_session_id_context()
  265.       }
  266.   
  267. > int SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx,
  268.   			       unsigned int sid_ctx_len)
  269.       {

ssl/ssl_lib.c:270:8: Taking true branch
  268.   			       unsigned int sid_ctx_len)
  269.       {
  270.       if(sid_ctx_len > SSL_MAX_SID_CTX_LENGTH)
                ^
  271.   	{
  272.   	SSLerr(SSL_F_SSL_SET_SESSION_ID_CONTEXT,SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG);

ssl/ssl_lib.c:272:2: 
  270.       if(sid_ctx_len > SSL_MAX_SID_CTX_LENGTH)
  271.   	{
  272. > 	SSLerr(SSL_F_SSL_SET_SESSION_ID_CONTEXT,SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG);
  273.   	return 0;
  274.   	}

crypto/err/err.c:246:1: start of procedure ERR_put_error()
    244.   /********************************************************/
    245.   
    246. > void ERR_put_error(int lib, int func, int reason, const char *file,
    247.   	     int line)
    248.   	{

crypto/err/err.c:270:2: Skipping ERR_get_state(): empty list of specs
    268.   	}
    269.   #endif
    270.   	es=ERR_get_state();
            ^
    271.   
    272.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:272:2: 
    270.   	es=ERR_get_state();
    271.   
    272. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    273.   	if (es->top == es->bottom)
    274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:273:6: Taking false branch
    271.   
    272.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    273.   	if (es->top == es->bottom)
                ^
    274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:275:2: 
    273.   	if (es->top == es->bottom)
    274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    275. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    276.   	es->err_file[es->top]=file;
    277.   	es->err_line[es->top]=line;

crypto/err/err.c:276:2: 
    274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    276. > 	es->err_file[es->top]=file;
    277.   	es->err_line[es->top]=line;
    278.   	err_clear_data(es,es->top);

crypto/err/err.c:277:2: 
    275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    276.   	es->err_file[es->top]=file;
    277. > 	es->err_line[es->top]=line;
    278.   	err_clear_data(es,es->top);
    279.   	}

crypto/err/err.c:278:2: Taking true branch
    276.   	es->err_file[es->top]=file;
    277.   	es->err_line[es->top]=line;
    278.   	err_clear_data(es,es->top);
            ^
    279.   	}
    280.   

crypto/err/err.c:278:2: Taking false branch
    276.   	es->err_file[es->top]=file;
    277.   	es->err_line[es->top]=line;
    278.   	err_clear_data(es,es->top);
            ^
    279.   	}
    280.   

crypto/err/err.c:279:2: return from a call to ERR_put_error
    277.   	es->err_line[es->top]=line;
    278.   	err_clear_data(es,es->top);
    279.   	}
            ^
    280.   
    281.   void ERR_clear_error(void)

ssl/ssl_lib.c:273:2: 
  271.   	{
  272.   	SSLerr(SSL_F_SSL_SET_SESSION_ID_CONTEXT,SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG);
  273. > 	return 0;
  274.   	}
  275.       ssl->sid_ctx_length=sid_ctx_len;

ssl/ssl_lib.c:279:5: return from a call to SSL_set_session_id_context
  277.   
  278.       return 1;
  279.       }
             ^
  280.   
  281.   int SSL_CTX_set_purpose(SSL_CTX *s, int purpose)

apps/s_server.c:790:2: Skipping SSL_clear(): empty list of specs
788.   						 strlen((char *)context));
789.   	}
790.   	SSL_clear(con);
        ^
791.   
792.   	sbio=BIO_new_socket(s,BIO_NOCLOSE);

apps/s_server.c:792:2: 
790.   	SSL_clear(con);
791.   
792. > 	sbio=BIO_new_socket(s,BIO_NOCLOSE);
793.   	if (s_nbio_test)
794.   		{

crypto/bio/bss_sock.c:124:1: start of procedure BIO_new_socket()
  122.   
  123.   #ifndef BIO_FD
  124. > BIO *BIO_new_socket(int fd, int close_flag)
  125.   #else
  126.   BIO *BIO_new_fd(int fd,int close_flag)

crypto/bio/bss_sock.c:132:2: 
  130.   
  131.   #ifndef BIO_FD
  132. > 	ret=BIO_new(BIO_s_socket());
  133.   #else
  134.   	ret=BIO_new(BIO_s_fd());

crypto/bio/bss_sock.c:100:1: start of procedure BIO_s_socket()
    98.   	};
    99.   
    100. > BIO_METHOD *BIO_s_socket(void)
    101.   	{
    102.   	return(&methods_sockp);

crypto/bio/bss_sock.c:102:2: 
    100.   BIO_METHOD *BIO_s_socket(void)
    101.   	{
    102. > 	return(&methods_sockp);
    103.   	}
    104.   #else

crypto/bio/bss_sock.c:103:2: return from a call to BIO_s_socket
    101.   	{
    102.   	return(&methods_sockp);
    103.   	}
            ^
    104.   #else
    105.   static BIO_METHOD methods_fdp=

crypto/bio/bio_lib.c:69:1: start of procedure BIO_new()
    67.   static int bio_meth_num=0;
    68.   
    69. > BIO *BIO_new(BIO_METHOD *method)
    70.   	{
    71.   	BIO *ret=NULL;

crypto/bio/bio_lib.c:71:2: 
    69.   BIO *BIO_new(BIO_METHOD *method)
    70.   	{
    71. > 	BIO *ret=NULL;
    72.   
    73.   	ret=(BIO *)Malloc(sizeof(BIO));

crypto/bio/bio_lib.c:73:2: 
    71.   	BIO *ret=NULL;
    72.   
    73. > 	ret=(BIO *)Malloc(sizeof(BIO));
    74.   	if (ret == NULL)
    75.   		{

crypto/mem.c:194:1: start of procedure CRYPTO_malloc()
      192.   	}
      193.   
      194. > void *CRYPTO_malloc(int num, const char *file, int line)
      195.   	{
      196.   	char *ret = NULL;

crypto/mem.c:196:2: 
      194.   void *CRYPTO_malloc(int num, const char *file, int line)
      195.   	{
      196. > 	char *ret = NULL;
      197.   
      198.   	allow_customize = 0;

crypto/mem.c:198:2: 
      196.   	char *ret = NULL;
      197.   
      198. > 	allow_customize = 0;
      199.   	if (malloc_debug_func != NULL)
      200.   		{

crypto/mem.c:199:6: Taking true branch
      197.   
      198.   	allow_customize = 0;
      199.   	if (malloc_debug_func != NULL)
                  ^
      200.   		{
      201.   		allow_customize_debug = 0;

crypto/mem.c:201:3: 
      199.   	if (malloc_debug_func != NULL)
      200.   		{
      201. > 		allow_customize_debug = 0;
      202.   		malloc_debug_func(NULL, num, file, line, 0);
      203.   		}

crypto/mem.c:202:3: Skipping __function_pointer__(): unresolved function pointer
      200.   		{
      201.   		allow_customize_debug = 0;
      202.   		malloc_debug_func(NULL, num, file, line, 0);
               ^
      203.   		}
      204.   	ret = malloc_func(num);

crypto/mem.c:204:2: Skipping __function_pointer__(): unresolved function pointer
      202.   		malloc_debug_func(NULL, num, file, line, 0);
      203.   		}
      204.   	ret = malloc_func(num);
              ^
      205.   #ifdef LEVITTE_DEBUG
      206.   	fprintf(stderr, "LEVITTE_DEBUG:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:208:6: Taking true branch
      206.   	fprintf(stderr, "LEVITTE_DEBUG:         > 0x%p (%d)\n", ret, num);
      207.   #endif
      208.   	if (malloc_debug_func != NULL)
                  ^
      209.   		malloc_debug_func(ret, num, file, line, 1);
      210.   

crypto/mem.c:209:3: Skipping __function_pointer__(): unresolved function pointer
      207.   #endif
      208.   	if (malloc_debug_func != NULL)
      209.   		malloc_debug_func(ret, num, file, line, 1);
               ^
      210.   
      211.   	return ret;

crypto/mem.c:211:2: 
      209.   		malloc_debug_func(ret, num, file, line, 1);
      210.   
      211. > 	return ret;
      212.   	}
      213.   

crypto/mem.c:212:2: return from a call to CRYPTO_malloc
      210.   
      211.   	return ret;
      212.   	}
              ^
      213.   
      214.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/bio/bio_lib.c:74:6: Taking false branch
    72.   
    73.   	ret=(BIO *)Malloc(sizeof(BIO));
    74.   	if (ret == NULL)
               ^
    75.   		{
    76.   		BIOerr(BIO_F_BIO_NEW,ERR_R_MALLOC_FAILURE);

crypto/bio/bio_lib.c:79:7: 
    77.   		return(NULL);
    78.   		}
    79. > 	if (!BIO_set(ret,method))
    80.   		{
    81.   		Free(ret);

crypto/bio/bio_lib.c:87:1: start of procedure BIO_set()
      85.   	}
      86.   
      87. > int BIO_set(BIO *bio, BIO_METHOD *method)
      88.   	{
      89.   	bio->method=method;

crypto/bio/bio_lib.c:89:2: 
      87.   int BIO_set(BIO *bio, BIO_METHOD *method)
      88.   	{
      89. > 	bio->method=method;
      90.   	bio->callback=NULL;
      91.   	bio->cb_arg=NULL;

crypto/bio/bio_lib.c:90:2: 
      88.   	{
      89.   	bio->method=method;
      90. > 	bio->callback=NULL;
      91.   	bio->cb_arg=NULL;
      92.   	bio->init=0;

crypto/bio/bio_lib.c:91:2: 
      89.   	bio->method=method;
      90.   	bio->callback=NULL;
      91. > 	bio->cb_arg=NULL;
      92.   	bio->init=0;
      93.   	bio->shutdown=1;

crypto/bio/bio_lib.c:92:2: 
      90.   	bio->callback=NULL;
      91.   	bio->cb_arg=NULL;
      92. > 	bio->init=0;
      93.   	bio->shutdown=1;
      94.   	bio->flags=0;

crypto/bio/bio_lib.c:93:2: 
      91.   	bio->cb_arg=NULL;
      92.   	bio->init=0;
      93. > 	bio->shutdown=1;
      94.   	bio->flags=0;
      95.   	bio->retry_reason=0;

crypto/bio/bio_lib.c:94:2: 
      92.   	bio->init=0;
      93.   	bio->shutdown=1;
      94. > 	bio->flags=0;
      95.   	bio->retry_reason=0;
      96.   	bio->num=0;

crypto/bio/bio_lib.c:95:2: 
      93.   	bio->shutdown=1;
      94.   	bio->flags=0;
      95. > 	bio->retry_reason=0;
      96.   	bio->num=0;
      97.   	bio->ptr=NULL;

crypto/bio/bio_lib.c:96:2: 
      94.   	bio->flags=0;
      95.   	bio->retry_reason=0;
      96. > 	bio->num=0;
      97.   	bio->ptr=NULL;
      98.   	bio->prev_bio=NULL;

crypto/bio/bio_lib.c:97:2: 
      95.   	bio->retry_reason=0;
      96.   	bio->num=0;
      97. > 	bio->ptr=NULL;
      98.   	bio->prev_bio=NULL;
      99.   	bio->next_bio=NULL;

crypto/bio/bio_lib.c:98:2: 
      96.   	bio->num=0;
      97.   	bio->ptr=NULL;
      98. > 	bio->prev_bio=NULL;
      99.   	bio->next_bio=NULL;
      100.   	bio->references=1;

crypto/bio/bio_lib.c:99:2: 
      97.   	bio->ptr=NULL;
      98.   	bio->prev_bio=NULL;
      99. > 	bio->next_bio=NULL;
      100.   	bio->references=1;
      101.   	bio->num_read=0L;

crypto/bio/bio_lib.c:100:2: 
      98.   	bio->prev_bio=NULL;
      99.   	bio->next_bio=NULL;
      100. > 	bio->references=1;
      101.   	bio->num_read=0L;
      102.   	bio->num_write=0L;

crypto/bio/bio_lib.c:101:2: 
      99.   	bio->next_bio=NULL;
      100.   	bio->references=1;
      101. > 	bio->num_read=0L;
      102.   	bio->num_write=0L;
      103.   	CRYPTO_new_ex_data(bio_meth,bio,&bio->ex_data);

crypto/bio/bio_lib.c:102:2: 
      100.   	bio->references=1;
      101.   	bio->num_read=0L;
      102. > 	bio->num_write=0L;
      103.   	CRYPTO_new_ex_data(bio_meth,bio,&bio->ex_data);
      104.   	if (method->create != NULL)

crypto/bio/bio_lib.c:103:2: 
      101.   	bio->num_read=0L;
      102.   	bio->num_write=0L;
      103. > 	CRYPTO_new_ex_data(bio_meth,bio,&bio->ex_data);
      104.   	if (method->create != NULL)
      105.   		if (!method->create(bio))

crypto/ex_data.c:201:1: start of procedure CRYPTO_new_ex_data()
        199.   	}
        200.   
        201. > void CRYPTO_new_ex_data(STACK_OF(CRYPTO_EX_DATA_FUNCS) *meth, void *obj, CRYPTO_EX_DATA *ad)
        202.   	{
        203.   	CRYPTO_EX_DATA_FUNCS *m;

crypto/ex_data.c:207:2: 
        205.   	int i,max;
        206.   
        207. > 	ad->sk=NULL;
        208.   	if (meth != NULL)
        209.   		{

crypto/ex_data.c:208:6: Taking false branch
        206.   
        207.   	ad->sk=NULL;
        208.   	if (meth != NULL)
                    ^
        209.   		{
        210.   		max=sk_CRYPTO_EX_DATA_FUNCS_num(meth);

crypto/ex_data.c:208:2: 
        206.   
        207.   	ad->sk=NULL;
        208. > 	if (meth != NULL)
        209.   		{
        210.   		max=sk_CRYPTO_EX_DATA_FUNCS_num(meth);

crypto/ex_data.c:221:2: return from a call to CRYPTO_new_ex_data
        219.   			}
        220.   		}
        221.   	}
                ^
        222.   
        223.   IMPLEMENT_STACK_OF(CRYPTO_EX_DATA_FUNCS)

crypto/bio/bio_lib.c:104:6: Taking false branch
      102.   	bio->num_write=0L;
      103.   	CRYPTO_new_ex_data(bio_meth,bio,&bio->ex_data);
      104.   	if (method->create != NULL)
                  ^
      105.   		if (!method->create(bio))
      106.   			return(0);

crypto/bio/bio_lib.c:107:2: 
      105.   		if (!method->create(bio))
      106.   			return(0);
      107. > 	return(1);
      108.   	}
      109.   

crypto/bio/bio_lib.c:108:2: return from a call to BIO_set
      106.   			return(0);
      107.   	return(1);
      108.   	}
              ^
      109.   
      110.   int BIO_free(BIO *a)

crypto/bio/bio_lib.c:79:7: Taking false branch
    77.   		return(NULL);
    78.   		}
    79.   	if (!BIO_set(ret,method))
                ^
    80.   		{
    81.   		Free(ret);

crypto/bio/bio_lib.c:84:2: 
    82.   		ret=NULL;
    83.   		}
    84. > 	return(ret);
    85.   	}
    86.   

crypto/bio/bio_lib.c:85:2: return from a call to BIO_new
    83.   		}
    84.   	return(ret);
    85.   	}
           ^
    86.   
    87.   int BIO_set(BIO *bio, BIO_METHOD *method)

crypto/bio/bss_sock.c:136:6: Taking false branch
  134.   	ret=BIO_new(BIO_s_fd());
  135.   #endif
  136.   	if (ret == NULL) return(NULL);
              ^
  137.   	BIO_set_fd(ret,fd,close_flag);
  138.   	return(ret);

crypto/bio/bss_sock.c:137:2: 
  135.   #endif
  136.   	if (ret == NULL) return(NULL);
  137. > 	BIO_set_fd(ret,fd,close_flag);
  138.   	return(ret);
  139.   	}

crypto/bio/bio_lib.c:275:1: start of procedure BIO_int_ctrl()
    273.   	}
    274.   
    275. > long BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg)
    276.   	{
    277.   	int i;

crypto/bio/bio_lib.c:279:2: 
    277.   	int i;
    278.   
    279. > 	i=iarg;
    280.   	return(BIO_ctrl(b,cmd,larg,(char *)&i));
    281.   	}

crypto/bio/bio_lib.c:280:2: 
    278.   
    279.   	i=iarg;
    280. > 	return(BIO_ctrl(b,cmd,larg,(char *)&i));
    281.   	}
    282.   

crypto/bio/bio_lib.c:293:1: start of procedure BIO_ctrl()
      291.   	}
      292.   
      293. > long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)
      294.   	{
      295.   	long ret;

crypto/bio/bio_lib.c:298:6: Taking false branch
      296.   	long (*cb)();
      297.   
      298.   	if (b == NULL) return(0);
                  ^
      299.   
      300.   	if ((b->method == NULL) || (b->method->ctrl == NULL))

crypto/bio/bio_lib.c:300:7: Taking false branch
      298.   	if (b == NULL) return(0);
      299.   
      300.   	if ((b->method == NULL) || (b->method->ctrl == NULL))
                   ^
      301.   		{
      302.   		BIOerr(BIO_F_BIO_CTRL,BIO_R_UNSUPPORTED_METHOD);

crypto/bio/bio_lib.c:300:30: Taking true branch
      298.   	if (b == NULL) return(0);
      299.   
      300.   	if ((b->method == NULL) || (b->method->ctrl == NULL))
                                          ^
      301.   		{
      302.   		BIOerr(BIO_F_BIO_CTRL,BIO_R_UNSUPPORTED_METHOD);

crypto/bio/bio_lib.c:302:3: 
      300.   	if ((b->method == NULL) || (b->method->ctrl == NULL))
      301.   		{
      302. > 		BIOerr(BIO_F_BIO_CTRL,BIO_R_UNSUPPORTED_METHOD);
      303.   		return(-2);
      304.   		}

crypto/err/err.c:246:1: start of procedure ERR_put_error()
        244.   /********************************************************/
        245.   
        246. > void ERR_put_error(int lib, int func, int reason, const char *file,
        247.   	     int line)
        248.   	{

crypto/err/err.c:270:2: Skipping ERR_get_state(): empty list of specs
        268.   	}
        269.   #endif
        270.   	es=ERR_get_state();
                ^
        271.   
        272.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:272:2: 
        270.   	es=ERR_get_state();
        271.   
        272. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
        273.   	if (es->top == es->bottom)
        274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:273:6: Taking false branch
        271.   
        272.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
        273.   	if (es->top == es->bottom)
                    ^
        274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
        275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:275:2: 
        273.   	if (es->top == es->bottom)
        274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
        275. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
        276.   	es->err_file[es->top]=file;
        277.   	es->err_line[es->top]=line;

crypto/err/err.c:276:2: 
        274.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
        275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
        276. > 	es->err_file[es->top]=file;
        277.   	es->err_line[es->top]=line;
        278.   	err_clear_data(es,es->top);

crypto/err/err.c:277:2: 
        275.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
        276.   	es->err_file[es->top]=file;
        277. > 	es->err_line[es->top]=line;
        278.   	err_clear_data(es,es->top);
        279.   	}

crypto/err/err.c:278:2: Taking true branch
        276.   	es->err_file[es->top]=file;
        277.   	es->err_line[es->top]=line;
        278.   	err_clear_data(es,es->top);
                ^
        279.   	}
        280.   

crypto/err/err.c:278:2: Taking false branch
        276.   	es->err_file[es->top]=file;
        277.   	es->err_line[es->top]=line;
        278.   	err_clear_data(es,es->top);
                ^
        279.   	}
        280.   

crypto/err/err.c:279:2: return from a call to ERR_put_error
        277.   	es->err_line[es->top]=line;
        278.   	err_clear_data(es,es->top);
        279.   	}
                ^
        280.   
        281.   void ERR_clear_error(void)

crypto/bio/bio_lib.c:303:3: 
      301.   		{
      302.   		BIOerr(BIO_F_BIO_CTRL,BIO_R_UNSUPPORTED_METHOD);
      303. > 		return(-2);
      304.   		}
      305.   

crypto/bio/bio_lib.c:318:2: return from a call to BIO_ctrl
      316.   			larg,ret);
      317.   	return(ret);
      318.   	}
              ^
      319.   
      320.   /* It is unfortunate to duplicate in functions what the BIO_(w)pending macros

crypto/bio/bio_lib.c:281:2: return from a call to BIO_int_ctrl
    279.   	i=iarg;
    280.   	return(BIO_ctrl(b,cmd,larg,(char *)&i));
    281.   	}
            ^
    282.   
    283.   char *BIO_ptr_ctrl(BIO *b, int cmd, long larg)

crypto/bio/bss_sock.c:138:2: 
  136.   	if (ret == NULL) return(NULL);
  137.   	BIO_set_fd(ret,fd,close_flag);
  138. > 	return(ret);
  139.   	}
  140.   

crypto/bio/bss_sock.c:139:2: return from a call to BIO_new_socket
  137.   	BIO_set_fd(ret,fd,close_flag);
  138.   	return(ret);
  139.   	}
          ^
  140.   
  141.   #ifndef BIO_FD

apps/s_server.c:793:6: Taking false branch
791.   
792.   	sbio=BIO_new_socket(s,BIO_NOCLOSE);
793.   	if (s_nbio_test)
            ^
794.   		{
795.   		BIO *test;

apps/s_server.c:800:2: 
798.   		sbio=BIO_push(test,sbio);
799.   		}
800. > 	SSL_set_bio(con,sbio,sbio);
801.   	SSL_set_accept_state(con);
802.   	/* SSL_set_fd(con,s); */

ssl/ssl_lib.c:386:1: start of procedure SSL_set_bio()
  384.   	}
  385.   
  386. > void SSL_set_bio(SSL *s,BIO *rbio,BIO *wbio)
  387.   	{
  388.   	/* If the output buffering BIO is still in place, remove it

ssl/ssl_lib.c:390:6: 
  388.   	/* If the output buffering BIO is still in place, remove it
  389.   	 */
  390. > 	if (s->bbio != NULL)
  391.   		{
  392.   		if (s->wbio == s->bbio)

static int sv_body(char *hostname, int s, unsigned char *context)
	{
	char *buf=NULL;
	fd_set readfds;
	int ret=1,width;
	int k,i;
	unsigned long l;
	SSL *con=NULL;
	BIO *sbio;
#ifdef WINDOWS
	struct timeval tv;
#endif
	if ((buf=Malloc(bufsize)) == NULL)
		{
		BIO_printf(bio_err,"out of memory\n");
		goto err;
		}
#ifdef FIONBIO
	if (s_nbio)
		{
		unsigned long sl=1;
		if (!s_quiet)
			BIO_printf(bio_err,"turning on non blocking io\n");
		if (BIO_socket_ioctl(s,FIONBIO,&sl) < 0)
			ERR_print_errors(bio_err);
		}
#endif
	if (con == NULL) {
		con=(SSL *)SSL_new(ctx);
		if(context)
		      SSL_set_session_id_context(con, context,
						 strlen((char *)context));
	}
	SSL_clear(con);
	sbio=BIO_new_socket(s,BIO_NOCLOSE);
	if (s_nbio_test)
		{
		BIO *test;
		test=BIO_new(BIO_f_nbio_test());
		sbio=BIO_push(test,sbio);
		}
	SSL_set_bio(con,sbio,sbio);
	SSL_set_accept_state(con);
	if (s_debug)
		{
		con->debug=1;
		BIO_set_callback(SSL_get_rbio(con),bio_dump_cb);
		BIO_set_callback_arg(SSL_get_rbio(con),bio_s_out);
		}
	width=s+1;
	for (;;)
		{
		FD_ZERO(&readfds);
#ifndef WINDOWS
		FD_SET(fileno(stdin),&readfds);
#endif
		FD_SET(s,&readfds);
#ifdef WINDOWS
		tv.tv_sec = 1;
		tv.tv_usec = 0;
		i=select(width,(void *)&readfds,NULL,NULL,&tv);
		if((i < 0) || (!i && !_kbhit() ) )continue;
		if(_kbhit())
#else
  		i=select(width,(void *)&readfds,NULL,NULL,NULL);
  		if (i <= 0) continue;
  		if (FD_ISSET(fileno(stdin),&readfds))
#endif
			{
			if (s_crlf)
				{
				int j, lf_num;
				i=read(fileno(stdin), buf, bufsize/2);
				lf_num = 0;
				for (j = 0; j < i; j++)
					if (buf[j] == '\n')
						lf_num++;
				for (j = i-1; j >= 0; j--)
					{
					buf[j+lf_num] = buf[j];
					if (buf[j] == '\n')
						{
						lf_num--;
						i++;
						buf[j+lf_num] = '\r';
						}
					}
				assert(lf_num == 0);
				}
			else
				i=read(fileno(stdin),buf,bufsize);
			if (!s_quiet)
				{
				if ((i <= 0) || (buf[0] == 'Q'))
					{
					BIO_printf(bio_s_out,"DONE\n");
					SHUTDOWN(s);
					close_accept_socket();
					ret= -11;
					goto err;
					}
				if ((i <= 0) || (buf[0] == 'q'))
					{
					BIO_printf(bio_s_out,"DONE\n");
					SHUTDOWN(s);
					goto err;
					}
				if ((buf[0] == 'r') &&
					((buf[1] == '\n') || (buf[1] == '\r')))
					{
					SSL_renegotiate(con);
					i=SSL_do_handshake(con);
					printf("SSL_do_handshake -> %d\n",i);
					i=0;
					continue;
					}
				if ((buf[0] == 'R') &&
					((buf[1] == '\n') || (buf[1] == '\r')))
					{
					SSL_set_verify(con,
						SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE,NULL);
					SSL_renegotiate(con);
					i=SSL_do_handshake(con);
					printf("SSL_do_handshake -> %d\n",i);
					i=0;
					continue;
					}
				if (buf[0] == 'P')
					{
					static char *str="Lets print some clear text\n";
					BIO_write(SSL_get_wbio(con),str,strlen(str));
					}
				if (buf[0] == 'S')
					{
					print_stats(bio_s_out,SSL_get_SSL_CTX(con));
					}
				}
#ifdef CHARSET_EBCDIC
			ebcdic2ascii(buf,buf,i);
#endif
			l=k=0;
			for (;;)
				{
#ifdef RENEG
{ static count=0; if (++count == 100) { count=0; SSL_renegotiate(con); } }
#endif
				k=SSL_write(con,&(buf[l]),(unsigned int)i);
				switch (SSL_get_error(con,k))
					{
				case SSL_ERROR_NONE:
					break;
				case SSL_ERROR_WANT_WRITE:
				case SSL_ERROR_WANT_READ:
				case SSL_ERROR_WANT_X509_LOOKUP:
					BIO_printf(bio_s_out,"Write BLOCK\n");
					break;
				case SSL_ERROR_SYSCALL:
				case SSL_ERROR_SSL:
					BIO_printf(bio_s_out,"ERROR\n");
					ERR_print_errors(bio_err);
					ret=1;
					goto err;
				case SSL_ERROR_ZERO_RETURN:
					BIO_printf(bio_s_out,"DONE\n");
					ret=1;
					goto err;
					}
				l+=k;
				i-=k;
				if (i <= 0) break;
				}
			}
		if (FD_ISSET(s,&readfds))
			{
			if (!SSL_is_init_finished(con))
				{
				i=init_ssl_connection(con);
				if (i < 0)
					{
					ret=0;
					goto err;
					}
				else if (i == 0)
					{
					ret=1;
					goto err;
					}
				}
			else
				{
again:
				i=SSL_read(con,(char *)buf,bufsize);
				switch (SSL_get_error(con,i))
					{
				case SSL_ERROR_NONE:
#ifdef CHARSET_EBCDIC
					ascii2ebcdic(buf,buf,i);
#endif
					write(fileno(stdout),buf,
						(unsigned int)i);
					if (SSL_pending(con)) goto again;
					break;
				case SSL_ERROR_WANT_WRITE:
				case SSL_ERROR_WANT_READ:
				case SSL_ERROR_WANT_X509_LOOKUP:
					BIO_printf(bio_s_out,"Read BLOCK\n");
					break;
				case SSL_ERROR_SYSCALL:
				case SSL_ERROR_SSL:
					BIO_printf(bio_s_out,"ERROR\n");
					ERR_print_errors(bio_err);
					ret=1;
					goto err;
				case SSL_ERROR_ZERO_RETURN:
					BIO_printf(bio_s_out,"DONE\n");
					ret=1;
					goto err;
					}
				}
			}
		}
err:
	BIO_printf(bio_s_out,"shutting down SSL\n");
#if 1
	SSL_set_shutdown(con,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
#else
	SSL_shutdown(con);
#endif
	if (con != NULL) SSL_free(con);
	BIO_printf(bio_s_out,"CONNECTION CLOSED\n");
	if (buf != NULL)
		{
		memset(buf,0,bufsize);
		Free(buf);
		}
	if (ret >= 0)
		BIO_printf(bio_s_out,"ACCEPT\n");
	return(ret);
	}
['static int sv_body(char *hostname, int s, unsigned char *context)\n\t{\n\tchar *buf=NULL;\n\tfd_set readfds;\n\tint ret=1,width;\n\tint k,i;\n\tunsigned long l;\n\tSSL *con=NULL;\n\tBIO *sbio;\n#ifdef WINDOWS\n\tstruct timeval tv;\n#endif\n\tif ((buf=Malloc(bufsize)) == NULL)\n\t\t{\n\t\tBIO_printf(bio_err,"out of memory\\n");\n\t\tgoto err;\n\t\t}\n#ifdef FIONBIO\n\tif (s_nbio)\n\t\t{\n\t\tunsigned long sl=1;\n\t\tif (!s_quiet)\n\t\t\tBIO_printf(bio_err,"turning on non blocking io\\n");\n\t\tif (BIO_socket_ioctl(s,FIONBIO,&sl) < 0)\n\t\t\tERR_print_errors(bio_err);\n\t\t}\n#endif\n\tif (con == NULL) {\n\t\tcon=(SSL *)SSL_new(ctx);\n\t\tif(context)\n\t\t      SSL_set_session_id_context(con, context,\n\t\t\t\t\t\t strlen((char *)context));\n\t}\n\tSSL_clear(con);\n\tsbio=BIO_new_socket(s,BIO_NOCLOSE);\n\tif (s_nbio_test)\n\t\t{\n\t\tBIO *test;\n\t\ttest=BIO_new(BIO_f_nbio_test());\n\t\tsbio=BIO_push(test,sbio);\n\t\t}\n\tSSL_set_bio(con,sbio,sbio);\n\tSSL_set_accept_state(con);\n\tif (s_debug)\n\t\t{\n\t\tcon->debug=1;\n\t\tBIO_set_callback(SSL_get_rbio(con),bio_dump_cb);\n\t\tBIO_set_callback_arg(SSL_get_rbio(con),bio_s_out);\n\t\t}\n\twidth=s+1;\n\tfor (;;)\n\t\t{\n\t\tFD_ZERO(&readfds);\n#ifndef WINDOWS\n\t\tFD_SET(fileno(stdin),&readfds);\n#endif\n\t\tFD_SET(s,&readfds);\n#ifdef WINDOWS\n\t\ttv.tv_sec = 1;\n\t\ttv.tv_usec = 0;\n\t\ti=select(width,(void *)&readfds,NULL,NULL,&tv);\n\t\tif((i < 0) || (!i && !_kbhit() ) )continue;\n\t\tif(_kbhit())\n#else\n  \t\ti=select(width,(void *)&readfds,NULL,NULL,NULL);\n  \t\tif (i <= 0) continue;\n  \t\tif (FD_ISSET(fileno(stdin),&readfds))\n#endif\n\t\t\t{\n\t\t\tif (s_crlf)\n\t\t\t\t{\n\t\t\t\tint j, lf_num;\n\t\t\t\ti=read(fileno(stdin), buf, bufsize/2);\n\t\t\t\tlf_num = 0;\n\t\t\t\tfor (j = 0; j < i; j++)\n\t\t\t\t\tif (buf[j] == \'\\n\')\n\t\t\t\t\t\tlf_num++;\n\t\t\t\tfor (j = i-1; j >= 0; j--)\n\t\t\t\t\t{\n\t\t\t\t\tbuf[j+lf_num] = buf[j];\n\t\t\t\t\tif (buf[j] == \'\\n\')\n\t\t\t\t\t\t{\n\t\t\t\t\t\tlf_num--;\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tbuf[j+lf_num] = \'\\r\';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tassert(lf_num == 0);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\ti=read(fileno(stdin),buf,bufsize);\n\t\t\tif (!s_quiet)\n\t\t\t\t{\n\t\t\t\tif ((i <= 0) || (buf[0] == \'Q\'))\n\t\t\t\t\t{\n\t\t\t\t\tBIO_printf(bio_s_out,"DONE\\n");\n\t\t\t\t\tSHUTDOWN(s);\n\t\t\t\t\tclose_accept_socket();\n\t\t\t\t\tret= -11;\n\t\t\t\t\tgoto err;\n\t\t\t\t\t}\n\t\t\t\tif ((i <= 0) || (buf[0] == \'q\'))\n\t\t\t\t\t{\n\t\t\t\t\tBIO_printf(bio_s_out,"DONE\\n");\n\t\t\t\t\tSHUTDOWN(s);\n\t\t\t\t\tgoto err;\n\t\t\t\t\t}\n\t\t\t\tif ((buf[0] == \'r\') &&\n\t\t\t\t\t((buf[1] == \'\\n\') || (buf[1] == \'\\r\')))\n\t\t\t\t\t{\n\t\t\t\t\tSSL_renegotiate(con);\n\t\t\t\t\ti=SSL_do_handshake(con);\n\t\t\t\t\tprintf("SSL_do_handshake -> %d\\n",i);\n\t\t\t\t\ti=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\tif ((buf[0] == \'R\') &&\n\t\t\t\t\t((buf[1] == \'\\n\') || (buf[1] == \'\\r\')))\n\t\t\t\t\t{\n\t\t\t\t\tSSL_set_verify(con,\n\t\t\t\t\t\tSSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE,NULL);\n\t\t\t\t\tSSL_renegotiate(con);\n\t\t\t\t\ti=SSL_do_handshake(con);\n\t\t\t\t\tprintf("SSL_do_handshake -> %d\\n",i);\n\t\t\t\t\ti=0;\n\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\tif (buf[0] == \'P\')\n\t\t\t\t\t{\n\t\t\t\t\tstatic char *str="Lets print some clear text\\n";\n\t\t\t\t\tBIO_write(SSL_get_wbio(con),str,strlen(str));\n\t\t\t\t\t}\n\t\t\t\tif (buf[0] == \'S\')\n\t\t\t\t\t{\n\t\t\t\t\tprint_stats(bio_s_out,SSL_get_SSL_CTX(con));\n\t\t\t\t\t}\n\t\t\t\t}\n#ifdef CHARSET_EBCDIC\n\t\t\tebcdic2ascii(buf,buf,i);\n#endif\n\t\t\tl=k=0;\n\t\t\tfor (;;)\n\t\t\t\t{\n#ifdef RENEG\n{ static count=0; if (++count == 100) { count=0; SSL_renegotiate(con); } }\n#endif\n\t\t\t\tk=SSL_write(con,&(buf[l]),(unsigned int)i);\n\t\t\t\tswitch (SSL_get_error(con,k))\n\t\t\t\t\t{\n\t\t\t\tcase SSL_ERROR_NONE:\n\t\t\t\t\tbreak;\n\t\t\t\tcase SSL_ERROR_WANT_WRITE:\n\t\t\t\tcase SSL_ERROR_WANT_READ:\n\t\t\t\tcase SSL_ERROR_WANT_X509_LOOKUP:\n\t\t\t\t\tBIO_printf(bio_s_out,"Write BLOCK\\n");\n\t\t\t\t\tbreak;\n\t\t\t\tcase SSL_ERROR_SYSCALL:\n\t\t\t\tcase SSL_ERROR_SSL:\n\t\t\t\t\tBIO_printf(bio_s_out,"ERROR\\n");\n\t\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\t\tret=1;\n\t\t\t\t\tgoto err;\n\t\t\t\tcase SSL_ERROR_ZERO_RETURN:\n\t\t\t\t\tBIO_printf(bio_s_out,"DONE\\n");\n\t\t\t\t\tret=1;\n\t\t\t\t\tgoto err;\n\t\t\t\t\t}\n\t\t\t\tl+=k;\n\t\t\t\ti-=k;\n\t\t\t\tif (i <= 0) break;\n\t\t\t\t}\n\t\t\t}\n\t\tif (FD_ISSET(s,&readfds))\n\t\t\t{\n\t\t\tif (!SSL_is_init_finished(con))\n\t\t\t\t{\n\t\t\t\ti=init_ssl_connection(con);\n\t\t\t\tif (i < 0)\n\t\t\t\t\t{\n\t\t\t\t\tret=0;\n\t\t\t\t\tgoto err;\n\t\t\t\t\t}\n\t\t\t\telse if (i == 0)\n\t\t\t\t\t{\n\t\t\t\t\tret=1;\n\t\t\t\t\tgoto err;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\nagain:\n\t\t\t\ti=SSL_read(con,(char *)buf,bufsize);\n\t\t\t\tswitch (SSL_get_error(con,i))\n\t\t\t\t\t{\n\t\t\t\tcase SSL_ERROR_NONE:\n#ifdef CHARSET_EBCDIC\n\t\t\t\t\tascii2ebcdic(buf,buf,i);\n#endif\n\t\t\t\t\twrite(fileno(stdout),buf,\n\t\t\t\t\t\t(unsigned int)i);\n\t\t\t\t\tif (SSL_pending(con)) goto again;\n\t\t\t\t\tbreak;\n\t\t\t\tcase SSL_ERROR_WANT_WRITE:\n\t\t\t\tcase SSL_ERROR_WANT_READ:\n\t\t\t\tcase SSL_ERROR_WANT_X509_LOOKUP:\n\t\t\t\t\tBIO_printf(bio_s_out,"Read BLOCK\\n");\n\t\t\t\t\tbreak;\n\t\t\t\tcase SSL_ERROR_SYSCALL:\n\t\t\t\tcase SSL_ERROR_SSL:\n\t\t\t\t\tBIO_printf(bio_s_out,"ERROR\\n");\n\t\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\t\tret=1;\n\t\t\t\t\tgoto err;\n\t\t\t\tcase SSL_ERROR_ZERO_RETURN:\n\t\t\t\t\tBIO_printf(bio_s_out,"DONE\\n");\n\t\t\t\t\tret=1;\n\t\t\t\t\tgoto err;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\nerr:\n\tBIO_printf(bio_s_out,"shutting down SSL\\n");\n#if 1\n\tSSL_set_shutdown(con,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);\n#else\n\tSSL_shutdown(con);\n#endif\n\tif (con != NULL) SSL_free(con);\n\tBIO_printf(bio_s_out,"CONNECTION CLOSED\\n");\n\tif (buf != NULL)\n\t\t{\n\t\tmemset(buf,0,bufsize);\n\t\tFree(buf);\n\t\t}\n\tif (ret >= 0)\n\t\tBIO_printf(bio_s_out,"ACCEPT\\n");\n\treturn(ret);\n\t}', 'void *CRYPTO_malloc(int num, const char *file, int line)\n\t{\n\tchar *ret = NULL;\n\tallow_customize = 0;\n\tif (malloc_debug_func != NULL)\n\t\t{\n\t\tallow_customize_debug = 0;\n\t\tmalloc_debug_func(NULL, num, file, line, 0);\n\t\t}\n\tret = malloc_func(num);\n#ifdef LEVITTE_DEBUG\n\tfprintf(stderr, "LEVITTE_DEBUG:         > 0x%p (%d)\\n", ret, num);\n#endif\n\tif (malloc_debug_func != NULL)\n\t\tmalloc_debug_func(ret, num, file, line, 1);\n\treturn ret;\n\t}', 'SSL *SSL_new(SSL_CTX *ctx)\n\t{\n\tSSL *s;\n\tif (ctx == NULL)\n\t\t{\n\t\tSSLerr(SSL_F_SSL_NEW,SSL_R_NULL_SSL_CTX);\n\t\treturn(NULL);\n\t\t}\n\tif (ctx->method == NULL)\n\t\t{\n\t\tSSLerr(SSL_F_SSL_NEW,SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);\n\t\treturn(NULL);\n\t\t}\n\ts=(SSL *)Malloc(sizeof(SSL));\n\tif (s == NULL) goto err;\n\tmemset(s,0,sizeof(SSL));\n\tif (ctx->cert != NULL)\n\t\t{\n\t\ts->cert = ssl_cert_dup(ctx->cert);\n\t\tif (s->cert == NULL)\n\t\t\tgoto err;\n\t\t}\n\telse\n\t\ts->cert=NULL;\n\ts->sid_ctx_length=ctx->sid_ctx_length;\n\tmemcpy(&s->sid_ctx,&ctx->sid_ctx,sizeof(s->sid_ctx));\n\ts->verify_mode=ctx->verify_mode;\n\ts->verify_depth=ctx->verify_depth;\n\ts->verify_callback=ctx->default_verify_callback;\n\ts->purpose = ctx->purpose;\n\ts->trust = ctx->trust;\n\tCRYPTO_add(&ctx->references,1,CRYPTO_LOCK_SSL_CTX);\n\ts->ctx=ctx;\n\ts->verify_result=X509_V_OK;\n\ts->method=ctx->method;\n\tif (!s->method->ssl_new(s))\n\t\tgoto err;\n\ts->quiet_shutdown=ctx->quiet_shutdown;\n\ts->references=1;\n\ts->server=(ctx->method->ssl_accept == ssl_undefined_function)?0:1;\n\ts->options=ctx->options;\n\ts->mode=ctx->mode;\n\tSSL_clear(s);\n\tCRYPTO_new_ex_data(ssl_meth,s,&s->ex_data);\n\treturn(s);\nerr:\n\tif (s != NULL)\n\t\t{\n\t\tif (s->cert != NULL)\n\t\t\tssl_cert_free(s->cert);\n\t\tif (s->ctx != NULL)\n\t\t\tSSL_CTX_free(s->ctx);\n\t\tFree(s);\n\t\t}\n\tSSLerr(SSL_F_SSL_NEW,ERR_R_MALLOC_FAILURE);\n\treturn(NULL);\n\t}', 'void ERR_put_error(int lib, int func, int reason, const char *file,\n\t     int line)\n\t{\n\tERR_STATE *es;\n#ifdef _OSD_POSIX\n\tif (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) {\n\t\tchar *end;\n\t\tfile += sizeof("*POSIX(")-1;\n\t\tend = &file[strlen(file)-1];\n\t\tif (*end == \')\')\n\t\t\t*end = \'\\0\';\n\t\tif ((end = strrchr(file, \'/\')) != NULL)\n\t\t\tfile = &end[1];\n\t}\n#endif\n\tes=ERR_get_state();\n\tes->top=(es->top+1)%ERR_NUM_ERRORS;\n\tif (es->top == es->bottom)\n\t\tes->bottom=(es->bottom+1)%ERR_NUM_ERRORS;\n\tes->err_buffer[es->top]=ERR_PACK(lib,func,reason);\n\tes->err_file[es->top]=file;\n\tes->err_line[es->top]=line;\n\terr_clear_data(es,es->top);\n\t}', 'int SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx,\n\t\t\t       unsigned int sid_ctx_len)\n    {\n    if(sid_ctx_len > SSL_MAX_SID_CTX_LENGTH)\n\t{\n\tSSLerr(SSL_F_SSL_SET_SESSION_ID_CONTEXT,SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG);\n\treturn 0;\n\t}\n    ssl->sid_ctx_length=sid_ctx_len;\n    memcpy(ssl->sid_ctx,sid_ctx,sid_ctx_len);\n    return 1;\n    }', 'BIO *BIO_new_socket(int fd, int close_flag)\n#else\nBIO *BIO_new_fd(int fd,int close_flag)\n#endif\n\t{\n\tBIO *ret;\n#ifndef BIO_FD\n\tret=BIO_new(BIO_s_socket());\n#else\n\tret=BIO_new(BIO_s_fd());\n#endif\n\tif (ret == NULL) return(NULL);\n\tBIO_set_fd(ret,fd,close_flag);\n\treturn(ret);\n\t}', 'BIO_METHOD *BIO_s_socket(void)\n\t{\n\treturn(&methods_sockp);\n\t}', 'BIO *BIO_new(BIO_METHOD *method)\n\t{\n\tBIO *ret=NULL;\n\tret=(BIO *)Malloc(sizeof(BIO));\n\tif (ret == NULL)\n\t\t{\n\t\tBIOerr(BIO_F_BIO_NEW,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tif (!BIO_set(ret,method))\n\t\t{\n\t\tFree(ret);\n\t\tret=NULL;\n\t\t}\n\treturn(ret);\n\t}', 'int BIO_set(BIO *bio, BIO_METHOD *method)\n\t{\n\tbio->method=method;\n\tbio->callback=NULL;\n\tbio->cb_arg=NULL;\n\tbio->init=0;\n\tbio->shutdown=1;\n\tbio->flags=0;\n\tbio->retry_reason=0;\n\tbio->num=0;\n\tbio->ptr=NULL;\n\tbio->prev_bio=NULL;\n\tbio->next_bio=NULL;\n\tbio->references=1;\n\tbio->num_read=0L;\n\tbio->num_write=0L;\n\tCRYPTO_new_ex_data(bio_meth,bio,&bio->ex_data);\n\tif (method->create != NULL)\n\t\tif (!method->create(bio))\n\t\t\treturn(0);\n\treturn(1);\n\t}', 'void CRYPTO_new_ex_data(STACK_OF(CRYPTO_EX_DATA_FUNCS) *meth, void *obj, CRYPTO_EX_DATA *ad)\n\t{\n\tCRYPTO_EX_DATA_FUNCS *m;\n\tvoid *ptr;\n\tint i,max;\n\tad->sk=NULL;\n\tif (meth != NULL)\n\t\t{\n\t\tmax=sk_CRYPTO_EX_DATA_FUNCS_num(meth);\n\t\tfor (i=0; i<max; i++)\n\t\t\t{\n\t\t\tm=sk_CRYPTO_EX_DATA_FUNCS_value(meth,i);\n\t\t\tif ((m != NULL) && (m->new_func != NULL))\n\t\t\t\t{\n\t\t\t\tptr=CRYPTO_get_ex_data(ad,i);\n\t\t\t\tm->new_func(obj,ptr,ad,i,m->argl,m->argp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}', 'long BIO_int_ctrl(BIO *b, int cmd, long larg, int iarg)\n\t{\n\tint i;\n\ti=iarg;\n\treturn(BIO_ctrl(b,cmd,larg,(char *)&i));\n\t}', 'long BIO_ctrl(BIO *b, int cmd, long larg, void *parg)\n\t{\n\tlong ret;\n\tlong (*cb)();\n\tif (b == NULL) return(0);\n\tif ((b->method == NULL) || (b->method->ctrl == NULL))\n\t\t{\n\t\tBIOerr(BIO_F_BIO_CTRL,BIO_R_UNSUPPORTED_METHOD);\n\t\treturn(-2);\n\t\t}\n\tcb=b->callback;\n\tif ((cb != NULL) &&\n\t\t((ret=cb(b,BIO_CB_CTRL,parg,cmd,larg,1L)) <= 0))\n\t\treturn(ret);\n\tret=b->method->ctrl(b,cmd,larg,parg);\n\tif (cb != NULL)\n\t\tret=cb(b,BIO_CB_CTRL|BIO_CB_RETURN,parg,cmd,\n\t\t\tlarg,ret);\n\treturn(ret);\n\t}', 'void SSL_set_bio(SSL *s,BIO *rbio,BIO *wbio)\n\t{\n\tif (s->bbio != NULL)\n\t\t{\n\t\tif (s->wbio == s->bbio)\n\t\t\t{\n\t\t\ts->wbio=s->wbio->next_bio;\n\t\t\ts->bbio->next_bio=NULL;\n\t\t\t}\n\t\t}\n\tif ((s->rbio != NULL) && (s->rbio != rbio))\n\t\tBIO_free_all(s->rbio);\n\tif ((s->wbio != NULL) && (s->wbio != wbio) && (s->rbio != s->wbio))\n\t\tBIO_free_all(s->wbio);\n\ts->rbio=rbio;\n\ts->wbio=wbio;\n\t}']