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


apps/s_server.c:891:1: start of procedure sv_body()
889.   	}
890.   
891. > static int sv_body(char *hostname, int s, unsigned char *context)
892.   	{
893.   	char *buf=NULL;

apps/s_server.c:893:2: 
891.   static int sv_body(char *hostname, int s, unsigned char *context)
892.   	{
893. > 	char *buf=NULL;
894.   	fd_set readfds;
895.   	int ret=1,width;

apps/s_server.c:895:2: 
893.   	char *buf=NULL;
894.   	fd_set readfds;
895. > 	int ret=1,width;
896.   	int k,i;
897.   	unsigned long l;

apps/s_server.c:898:2: 
896.   	int k,i;
897.   	unsigned long l;
898. > 	SSL *con=NULL;
899.   	BIO *sbio;
900.   #ifdef OPENSSL_SYS_WINDOWS

apps/s_server.c:904:6: 
902.   #endif
903.   
904. > 	if ((buf=OPENSSL_malloc(bufsize)) == NULL)
905.   		{
906.   		BIO_printf(bio_err,"out of memory\n");

crypto/mem.c:282:1: start of procedure CRYPTO_malloc()
  280.   	}
  281.   
  282. > void *CRYPTO_malloc(int num, const char *file, int line)
  283.   	{
  284.   	void *ret = NULL;

crypto/mem.c:284:2: 
  282.   void *CRYPTO_malloc(int num, const char *file, int line)
  283.   	{
  284. > 	void *ret = NULL;
  285.   
  286.   	allow_customize = 0;

crypto/mem.c:286:2: 
  284.   	void *ret = NULL;
  285.   
  286. > 	allow_customize = 0;
  287.   	if (malloc_debug_func != NULL)
  288.   		{

crypto/mem.c:287:6: Taking true branch
  285.   
  286.   	allow_customize = 0;
  287.   	if (malloc_debug_func != NULL)
              ^
  288.   		{
  289.   		allow_customize_debug = 0;

crypto/mem.c:289:3: 
  287.   	if (malloc_debug_func != NULL)
  288.   		{
  289. > 		allow_customize_debug = 0;
  290.   		malloc_debug_func(NULL, num, file, line, 0);
  291.   		}

crypto/mem.c:290:3: Skipping __function_pointer__(): unresolved function pointer
  288.   		{
  289.   		allow_customize_debug = 0;
  290.   		malloc_debug_func(NULL, num, file, line, 0);
           ^
  291.   		}
  292.   	ret = malloc_ex_func(num,file,line);

crypto/mem.c:292:2: Skipping __function_pointer__(): unresolved function pointer
  290.   		malloc_debug_func(NULL, num, file, line, 0);
  291.   		}
  292.   	ret = malloc_ex_func(num,file,line);
          ^
  293.   #ifdef LEVITTE_DEBUG_MEM
  294.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:296:6: Taking true branch
  294.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
  295.   #endif
  296.   	if (malloc_debug_func != NULL)
              ^
  297.   		malloc_debug_func(ret, num, file, line, 1);
  298.   

crypto/mem.c:297:3: Skipping __function_pointer__(): unresolved function pointer
  295.   #endif
  296.   	if (malloc_debug_func != NULL)
  297.   		malloc_debug_func(ret, num, file, line, 1);
           ^
  298.   
  299.   	return ret;

crypto/mem.c:299:2: 
  297.   		malloc_debug_func(ret, num, file, line, 1);
  298.   
  299. > 	return ret;
  300.   	}
  301.   

crypto/mem.c:300:2: return from a call to CRYPTO_malloc
  298.   
  299.   	return ret;
  300.   	}
          ^
  301.   
  302.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

apps/s_server.c:904:6: Taking false branch
902.   #endif
903.   
904.   	if ((buf=OPENSSL_malloc(bufsize)) == NULL)
            ^
905.   		{
906.   		BIO_printf(bio_err,"out of memory\n");

apps/s_server.c:910:6: Taking false branch
908.   		}
909.   #ifdef FIONBIO	
910.   	if (s_nbio)
            ^
911.   		{
912.   		unsigned long sl=1;

apps/s_server.c:921:6: Taking true branch
919.   #endif
920.   
921.   	if (con == NULL) {
            ^
922.   		con=SSL_new(ctx);
923.   #ifndef OPENSSL_NO_KRB5

apps/s_server.c:922:3: 
920.   
921.   	if (con == NULL) {
922. > 		con=SSL_new(ctx);
923.   #ifndef OPENSSL_NO_KRB5
924.   		if ((con->kssl_ctx = kssl_ctx_new()) != NULL)

ssl/ssl_lib.c:224:1: start of procedure SSL_new()
  222.   	}
  223.   
  224. > SSL *SSL_new(SSL_CTX *ctx)
  225.   	{
  226.   	SSL *s;

ssl/ssl_lib.c:228:6: Taking false branch
  226.   	SSL *s;
  227.   
  228.   	if (ctx == NULL)
              ^
  229.   		{
  230.   		SSLerr(SSL_F_SSL_NEW,SSL_R_NULL_SSL_CTX);

ssl/ssl_lib.c:233:6: Taking true branch
  231.   		return(NULL);
  232.   		}
  233.   	if (ctx->method == NULL)
              ^
  234.   		{
  235.   		SSLerr(SSL_F_SSL_NEW,SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);

ssl/ssl_lib.c:235:3: 
  233.   	if (ctx->method == NULL)
  234.   		{
  235. > 		SSLerr(SSL_F_SSL_NEW,SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
  236.   		return(NULL);
  237.   		}

crypto/err/err.c:615:1: start of procedure ERR_put_error()
    613.   /********************************************************/
    614.   
    615. > void ERR_put_error(int lib, int func, int reason, const char *file,
    616.   	     int line)
    617.   	{

crypto/err/err.c:639:2: Skipping ERR_get_state(): empty list of specs
    637.   	}
    638.   #endif
    639.   	es=ERR_get_state();
            ^
    640.   
    641.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:641:2: 
    639.   	es=ERR_get_state();
    640.   
    641. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    642.   	if (es->top == es->bottom)
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:642:6: Taking false branch
    640.   
    641.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    642.   	if (es->top == es->bottom)
                ^
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    644.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:644:2: 
    642.   	if (es->top == es->bottom)
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    644. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    645.   	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;

crypto/err/err.c:645:2: 
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    644.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    645. > 	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);

crypto/err/err.c:646:2: 
    644.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    645.   	es->err_file[es->top]=file;
    646. > 	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
    648.   	}

crypto/err/err.c:647:2: Taking true branch
    645.   	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
            ^
    648.   	}
    649.   

crypto/err/err.c:647:2: Taking false branch
    645.   	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
            ^
    648.   	}
    649.   

crypto/err/err.c:648:2: return from a call to ERR_put_error
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
    648.   	}
            ^
    649.   
    650.   void ERR_clear_error(void)

ssl/ssl_lib.c:236:3: 
  234.   		{
  235.   		SSLerr(SSL_F_SSL_NEW,SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION);
  236. > 		return(NULL);
  237.   		}
  238.   

ssl/ssl_lib.c:312:2: return from a call to SSL_new
  310.   	SSLerr(SSL_F_SSL_NEW,ERR_R_MALLOC_FAILURE);
  311.   	return(NULL);
  312.   	}
          ^
  313.   
  314.   int SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx,

apps/s_server.c:932:6: Taking true branch
930.                           }
931.   #endif	/* OPENSSL_NO_KRB5 */
932.   		if(context)
            ^
933.   		      SSL_set_session_id_context(con, context,
934.   						 strlen((char *)context));

apps/s_server.c:933:9: 
931.   #endif	/* OPENSSL_NO_KRB5 */
932.   		if(context)
933. > 		      SSL_set_session_id_context(con, context,
934.   						 strlen((char *)context));
935.   	}

ssl/ssl_lib.c:328:1: start of procedure SSL_set_session_id_context()
  326.       }
  327.   
  328. > int SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx,
  329.   			       unsigned int sid_ctx_len)
  330.       {

ssl/ssl_lib.c:331:8: Taking true branch
  329.   			       unsigned int sid_ctx_len)
  330.       {
  331.       if(sid_ctx_len > SSL_MAX_SID_CTX_LENGTH)
                ^
  332.   	{
  333.   	SSLerr(SSL_F_SSL_SET_SESSION_ID_CONTEXT,SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG);

ssl/ssl_lib.c:333:2: 
  331.       if(sid_ctx_len > SSL_MAX_SID_CTX_LENGTH)
  332.   	{
  333. > 	SSLerr(SSL_F_SSL_SET_SESSION_ID_CONTEXT,SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG);
  334.   	return 0;
  335.   	}

crypto/err/err.c:615:1: start of procedure ERR_put_error()
    613.   /********************************************************/
    614.   
    615. > void ERR_put_error(int lib, int func, int reason, const char *file,
    616.   	     int line)
    617.   	{

crypto/err/err.c:639:2: Skipping ERR_get_state(): empty list of specs
    637.   	}
    638.   #endif
    639.   	es=ERR_get_state();
            ^
    640.   
    641.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:641:2: 
    639.   	es=ERR_get_state();
    640.   
    641. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    642.   	if (es->top == es->bottom)
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:642:6: Taking false branch
    640.   
    641.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    642.   	if (es->top == es->bottom)
                ^
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    644.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:644:2: 
    642.   	if (es->top == es->bottom)
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    644. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    645.   	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;

crypto/err/err.c:645:2: 
    643.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    644.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    645. > 	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);

crypto/err/err.c:646:2: 
    644.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    645.   	es->err_file[es->top]=file;
    646. > 	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
    648.   	}

crypto/err/err.c:647:2: Taking true branch
    645.   	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
            ^
    648.   	}
    649.   

crypto/err/err.c:647:2: Taking false branch
    645.   	es->err_file[es->top]=file;
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
            ^
    648.   	}
    649.   

crypto/err/err.c:648:2: return from a call to ERR_put_error
    646.   	es->err_line[es->top]=line;
    647.   	err_clear_data(es,es->top);
    648.   	}
            ^
    649.   
    650.   void ERR_clear_error(void)

ssl/ssl_lib.c:334:2: 
  332.   	{
  333.   	SSLerr(SSL_F_SSL_SET_SESSION_ID_CONTEXT,SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG);
  334. > 	return 0;
  335.   	}
  336.       ssl->sid_ctx_length=sid_ctx_len;

ssl/ssl_lib.c:340:5: return from a call to SSL_set_session_id_context
  338.   
  339.       return 1;
  340.       }
             ^
  341.   
  342.   int SSL_CTX_set_generate_session_id(SSL_CTX *ctx, GEN_SESSION_CB cb)

apps/s_server.c:936:2: 
934.   						 strlen((char *)context));
935.   	}
936. > 	SSL_clear(con);
937.   
938.   	sbio=BIO_new_socket(s,BIO_NOCLOSE);
