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


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

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

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

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

apps/s_server.c:769:6: 
767.   #endif
768.   
769. > 	if ((buf=Malloc(bufsize)) == NULL)
770.   		{
771.   		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 false branch
  197.   
  198.   	allow_customize = 0;
  199.   	if (malloc_debug_func != NULL)
              ^
  200.   		{
  201.   		allow_customize_debug = 0;

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 false 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: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:769:6: Taking true branch
767.   #endif
768.   
769.   	if ((buf=Malloc(bufsize)) == NULL)
            ^
770.   		{
771.   		BIO_printf(bio_err,"out of memory\n");

apps/s_server.c:771:3: 
769.   	if ((buf=Malloc(bufsize)) == NULL)
770.   		{
771. > 		BIO_printf(bio_err,"out of memory\n");
772.   		goto err;
773.   		}

crypto/bio/b_print.c:80:1: start of procedure BIO_printf()
  78.   	const char *format, va_list args);
  79.   
  80. > int BIO_printf (BIO *bio, ...)
  81.   	{
  82.   	va_list args;

crypto/bio/b_print.c:87:2: 
  85.   	MS_STATIC char hugebuf[1024*2]; /* 10k in one chunk is the limit */
  86.   
  87. > 	va_start(args, bio);
  88.   	format=va_arg(args, char *);
  89.   

crypto/bio/b_print.c:88:2: 
  86.   
  87.   	va_start(args, bio);
  88. > 	format=va_arg(args, char *);
  89.   
  90.   	hugebuf[0]='\0';

crypto/bio/b_print.c:90:2: 
  88.   	format=va_arg(args, char *);
  89.   
  90. > 	hugebuf[0]='\0';
  91.   	dopr(hugebuf, sizeof(hugebuf), &ret, format, args);
  92.   	ret=BIO_write(bio, hugebuf, ret);

crypto/bio/b_print.c:91:2: Skipping dopr(): empty list of specs
  89.   
  90.   	hugebuf[0]='\0';
  91.   	dopr(hugebuf, sizeof(hugebuf), &ret, format, args);
         ^
  92.   	ret=BIO_write(bio, hugebuf, ret);
  93.   

crypto/bio/b_print.c:92:2: 
  90.   	hugebuf[0]='\0';
  91.   	dopr(hugebuf, sizeof(hugebuf), &ret, format, args);
  92. > 	ret=BIO_write(bio, hugebuf, ret);
  93.   
  94.   	va_end(args);

crypto/bio/bio_lib.c:172:1: start of procedure BIO_write()
    170.   	}
    171.   
    172. > int BIO_write(BIO *b, const char *in, int inl)
    173.   	{
    174.   	int i;

crypto/bio/bio_lib.c:177:6: Taking true branch
    175.   	long (*cb)();
    176.   
    177.   	if (b == NULL)
                ^
    178.   		return(0);
    179.   

crypto/bio/bio_lib.c:178:3: 
    176.   
    177.   	if (b == NULL)
    178. > 		return(0);
    179.   
    180.   	cb=b->callback;

crypto/bio/bio_lib.c:211:2: return from a call to BIO_write
    209.   			0L,(long)i);
    210.   	return(i);
    211.   	}
            ^
    212.   
    213.   int BIO_puts(BIO *b, const char *in)

crypto/bio/b_print.c:94:2: 
  92.   	ret=BIO_write(bio, hugebuf, ret);
  93.   
  94. > 	va_end(args);
  95.   	return(ret);
  96.   	}

crypto/bio/b_print.c:95:2: 
  93.   
  94.   	va_end(args);
  95. > 	return(ret);
  96.   	}
  97.   

crypto/bio/b_print.c:96:2: return from a call to BIO_printf
  94.   	va_end(args);
  95.   	return(ret);
  96.   	}
         ^
  97.   
  98.   /*

apps/s_server.c:1019:1: 
1017.   			}
1018.   		}
1019. > err:
1020.   	BIO_printf(bio_s_out,"shutting down SSL\n");
1021.   #if 1

apps/s_server.c:1020:2: 
1018.   		}
1019.   err:
1020. > 	BIO_printf(bio_s_out,"shutting down SSL\n");
1021.   #if 1
1022.   	SSL_set_shutdown(con,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);

crypto/bio/b_print.c:80:1: start of procedure BIO_printf()
  78.   	const char *format, va_list args);
  79.   
  80. > int BIO_printf (BIO *bio, ...)
  81.   	{
  82.   	va_list args;

crypto/bio/b_print.c:87:2: 
  85.   	MS_STATIC char hugebuf[1024*2]; /* 10k in one chunk is the limit */
  86.   
  87. > 	va_start(args, bio);
  88.   	format=va_arg(args, char *);
  89.   

crypto/bio/b_print.c:88:2: 
  86.   
  87.   	va_start(args, bio);
  88. > 	format=va_arg(args, char *);
  89.   
  90.   	hugebuf[0]='\0';

crypto/bio/b_print.c:90:2: 
  88.   	format=va_arg(args, char *);
  89.   
  90. > 	hugebuf[0]='\0';
  91.   	dopr(hugebuf, sizeof(hugebuf), &ret, format, args);
  92.   	ret=BIO_write(bio, hugebuf, ret);

crypto/bio/b_print.c:91:2: Skipping dopr(): empty list of specs
  89.   
  90.   	hugebuf[0]='\0';
  91.   	dopr(hugebuf, sizeof(hugebuf), &ret, format, args);
         ^
  92.   	ret=BIO_write(bio, hugebuf, ret);
  93.   

crypto/bio/b_print.c:92:2: 
  90.   	hugebuf[0]='\0';
  91.   	dopr(hugebuf, sizeof(hugebuf), &ret, format, args);
  92. > 	ret=BIO_write(bio, hugebuf, ret);
  93.   
  94.   	va_end(args);

crypto/bio/bio_lib.c:172:1: start of procedure BIO_write()
    170.   	}
    171.   
    172. > int BIO_write(BIO *b, const char *in, int inl)
    173.   	{
    174.   	int i;

crypto/bio/bio_lib.c:177:6: Taking true branch
    175.   	long (*cb)();
    176.   
    177.   	if (b == NULL)
                ^
    178.   		return(0);
    179.   

crypto/bio/bio_lib.c:178:3: 
    176.   
    177.   	if (b == NULL)
    178. > 		return(0);
    179.   
    180.   	cb=b->callback;

crypto/bio/bio_lib.c:211:2: return from a call to BIO_write
    209.   			0L,(long)i);
    210.   	return(i);
    211.   	}
            ^
    212.   
    213.   int BIO_puts(BIO *b, const char *in)

crypto/bio/b_print.c:94:2: 
  92.   	ret=BIO_write(bio, hugebuf, ret);
  93.   
  94. > 	va_end(args);
  95.   	return(ret);
  96.   	}

crypto/bio/b_print.c:95:2: 
  93.   
  94.   	va_end(args);
  95. > 	return(ret);
  96.   	}
  97.   

crypto/bio/b_print.c:96:2: return from a call to BIO_printf
  94.   	va_end(args);
  95.   	return(ret);
  96.   	}
         ^
  97.   
  98.   /*

apps/s_server.c:1022:2: 
1020.   	BIO_printf(bio_s_out,"shutting down SSL\n");
1021.   #if 1
1022. > 	SSL_set_shutdown(con,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
1023.   #else
1024.   	SSL_shutdown(con);

ssl/ssl_lib.c:1875:1: start of procedure SSL_set_shutdown()
  1873.   	}
  1874.   
  1875. > void SSL_set_shutdown(SSL *s,int mode)
  1876.   	{
  1877.   	s->shutdown=mode;

ssl/ssl_lib.c:1877:2: 
  1875.   void SSL_set_shutdown(SSL *s,int mode)
  1876.   	{
  1877. > 	s->shutdown=mode;
  1878.   	}
  1879.   
