apps/s_server.c:1171: error: NULL_DEREFERENCE
  pointer `con` last assigned on line 898 could be null and is dereferenced by call to `SSL_set_shutdown()` at line 1171, column 2.
Showing all 32 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 false branch
  285.   
  286.   	allow_customize = 0;
  287.   	if (malloc_debug_func != NULL)
              ^
  288.   		{
  289.   		allow_customize_debug = 0;

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 false 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: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 true 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:906:3: 
904.   	if ((buf=OPENSSL_malloc(bufsize)) == NULL)
905.   		{
906. > 		BIO_printf(bio_err,"out of memory\n");
907.   		goto err;
908.   		}

crypto/bio/b_print.c:755:1: start of procedure BIO_printf()
  753.   /***************************************************************************/
  754.   
  755. > int BIO_printf (BIO *bio, const char *format, ...)
  756.   	{
  757.   	va_list args;

crypto/bio/b_print.c:760:2: 
  758.   	int ret;
  759.   
  760. > 	va_start(args, format);
  761.   
  762.   	ret = BIO_vprintf(bio, format, args);

crypto/bio/b_print.c:762:2: Skipping BIO_vprintf(): empty list of specs
  760.   	va_start(args, format);
  761.   
  762.   	ret = BIO_vprintf(bio, format, args);
          ^
  763.   
  764.   	va_end(args);

crypto/bio/b_print.c:764:2: 
  762.   	ret = BIO_vprintf(bio, format, args);
  763.   
  764. > 	va_end(args);
  765.   	return(ret);
  766.   	}

crypto/bio/b_print.c:765:2: 
  763.   
  764.   	va_end(args);
  765. > 	return(ret);
  766.   	}
  767.   

crypto/bio/b_print.c:766:2: return from a call to BIO_printf
  764.   	va_end(args);
  765.   	return(ret);
  766.   	}
          ^
  767.   
  768.   int BIO_vprintf (BIO *bio, const char *format, va_list args)

apps/s_server.c:1168:1: 
1166.   			}
1167.   		}
1168. > err:
1169.   	BIO_printf(bio_s_out,"shutting down SSL\n");
1170.   #if 1

apps/s_server.c:1169:2: 
1167.   		}
1168.   err:
1169. > 	BIO_printf(bio_s_out,"shutting down SSL\n");
1170.   #if 1
1171.   	SSL_set_shutdown(con,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);

crypto/bio/b_print.c:755:1: start of procedure BIO_printf()
  753.   /***************************************************************************/
  754.   
  755. > int BIO_printf (BIO *bio, const char *format, ...)
  756.   	{
  757.   	va_list args;

crypto/bio/b_print.c:760:2: 
  758.   	int ret;
  759.   
  760. > 	va_start(args, format);
  761.   
  762.   	ret = BIO_vprintf(bio, format, args);

crypto/bio/b_print.c:762:2: Skipping BIO_vprintf(): empty list of specs
  760.   	va_start(args, format);
  761.   
  762.   	ret = BIO_vprintf(bio, format, args);
          ^
  763.   
  764.   	va_end(args);

crypto/bio/b_print.c:764:2: 
  762.   	ret = BIO_vprintf(bio, format, args);
  763.   
  764. > 	va_end(args);
  765.   	return(ret);
  766.   	}

crypto/bio/b_print.c:765:2: 
  763.   
  764.   	va_end(args);
  765. > 	return(ret);
  766.   	}
  767.   

crypto/bio/b_print.c:766:2: return from a call to BIO_printf
  764.   	va_end(args);
  765.   	return(ret);
  766.   	}
          ^
  767.   
  768.   int BIO_vprintf (BIO *bio, const char *format, va_list args)

apps/s_server.c:1171:2: 
1169.   	BIO_printf(bio_s_out,"shutting down SSL\n");
1170.   #if 1
1171. > 	SSL_set_shutdown(con,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
1172.   #else
1173.   	SSL_shutdown(con);

ssl/ssl_lib.c:2102:1: start of procedure SSL_set_shutdown()
  2100.   	}
  2101.   
  2102. > void SSL_set_shutdown(SSL *s,int mode)
  2103.   	{
  2104.   	s->shutdown=mode;

ssl/ssl_lib.c:2104:2: 
  2102.   void SSL_set_shutdown(SSL *s,int mode)
  2103.   	{
  2104. > 	s->shutdown=mode;
  2105.   	}
  2106.   
