apps/apps.c:1666: error: NULL_DEREFERENCE
  pointer `p` last assigned on line 1663 could be null and is dereferenced by call to `BUF_strlcat()` at line 1666, column 2.
Showing all 26 steps of the trace


apps/apps.c:1656:1: start of procedure make_config_name()
1654.   	}
1655.   
1656. > char *make_config_name()
1657.   	{
1658.   	const char *t=X509_get_default_cert_area();

apps/apps.c:1658:2: 
1656.   char *make_config_name()
1657.   	{
1658. > 	const char *t=X509_get_default_cert_area();
1659.   	size_t len;
1660.   	char *p;

crypto/x509/x509_def.c:67:1: start of procedure X509_get_default_cert_area()
  65.   	{ return(X509_PRIVATE_DIR); }
  66.   	
  67. > const char *X509_get_default_cert_area(void)
  68.   	{ return(X509_CERT_AREA); }
  69.   

crypto/x509/x509_def.c:68:4: 
  66.   	
  67.   const char *X509_get_default_cert_area(void)
  68. > 	{ return(X509_CERT_AREA); }
  69.   
  70.   const char *X509_get_default_cert_dir(void)

crypto/x509/x509_def.c:68:28: return from a call to X509_get_default_cert_area
  66.   	
  67.   const char *X509_get_default_cert_area(void)
  68.   	{ return(X509_CERT_AREA); }
                                   ^
  69.   
  70.   const char *X509_get_default_cert_dir(void)

apps/apps.c:1662:2: 
1660.   	char *p;
1661.   
1662. > 	len=strlen(t)+strlen(OPENSSL_CONF)+2;
1663.   	p=OPENSSL_malloc(len);
1664.   	BUF_strlcpy(p,t,len);

apps/apps.c:1663:2: 
1661.   
1662.   	len=strlen(t)+strlen(OPENSSL_CONF)+2;
1663. > 	p=OPENSSL_malloc(len);
1664.   	BUF_strlcpy(p,t,len);
1665.   #ifndef OPENSSL_SYS_VMS

crypto/mem.c:295:1: start of procedure CRYPTO_malloc()
  293.   	}
  294.   
  295. > void *CRYPTO_malloc(int num, const char *file, int line)
  296.   	{
  297.   	void *ret = NULL;

crypto/mem.c:297:2: 
  295.   void *CRYPTO_malloc(int num, const char *file, int line)
  296.   	{
  297. > 	void *ret = NULL;
  298.   
  299.   	if (num <= 0) return NULL;

crypto/mem.c:299:6: Taking false branch
  297.   	void *ret = NULL;
  298.   
  299.   	if (num <= 0) return NULL;
              ^
  300.   
  301.   	allow_customize = 0;

crypto/mem.c:301:2: 
  299.   	if (num <= 0) return NULL;
  300.   
  301. > 	allow_customize = 0;
  302.   	if (malloc_debug_func != NULL)
  303.   		{

crypto/mem.c:302:6: Taking true branch
  300.   
  301.   	allow_customize = 0;
  302.   	if (malloc_debug_func != NULL)
              ^
  303.   		{
  304.   		allow_customize_debug = 0;

crypto/mem.c:304:3: 
  302.   	if (malloc_debug_func != NULL)
  303.   		{
  304. > 		allow_customize_debug = 0;
  305.   		malloc_debug_func(NULL, num, file, line, 0);
  306.   		}

crypto/mem.c:305:3: Skipping __function_pointer__(): unresolved function pointer
  303.   		{
  304.   		allow_customize_debug = 0;
  305.   		malloc_debug_func(NULL, num, file, line, 0);
           ^
  306.   		}
  307.   	ret = malloc_ex_func(num,file,line);

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

crypto/mem.c:311:6: Taking true branch
  309.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
  310.   #endif
  311.   	if (malloc_debug_func != NULL)
              ^
  312.   		malloc_debug_func(ret, num, file, line, 1);
  313.   

crypto/mem.c:312:3: Skipping __function_pointer__(): unresolved function pointer
  310.   #endif
  311.   	if (malloc_debug_func != NULL)
  312.   		malloc_debug_func(ret, num, file, line, 1);
           ^
  313.   
  314.   #ifndef OPENSSL_CPUID_OBJ

crypto/mem.c:318:12: Taking false branch
  316.            * sanitisation function can't be optimised out. NB: We only do
  317.            * this for >2Kb so the overhead doesn't bother us. */
  318.           if(ret && (num > 2048))
                    ^
  319.   	{	extern unsigned char cleanse_ctr;
  320.                   ((unsigned char *)ret)[0] = cleanse_ctr;

crypto/mem.c:324:2: 
  322.   #endif
  323.   
  324. > 	return ret;
  325.   	}
  326.   char *CRYPTO_strdup(const char *str, const char *file, int line)

crypto/mem.c:325:2: return from a call to CRYPTO_malloc
  323.   
  324.   	return ret;
  325.   	}
          ^
  326.   char *CRYPTO_strdup(const char *str, const char *file, int line)
  327.   	{

apps/apps.c:1664:2: Skipping BUF_strlcpy(): empty list of specs
1662.   	len=strlen(t)+strlen(OPENSSL_CONF)+2;
1663.   	p=OPENSSL_malloc(len);
1664.   	BUF_strlcpy(p,t,len);
         ^
1665.   #ifndef OPENSSL_SYS_VMS
1666.   	BUF_strlcat(p,"/",len);

apps/apps.c:1666:2: 
1664.   	BUF_strlcpy(p,t,len);
1665.   #ifndef OPENSSL_SYS_VMS
1666. > 	BUF_strlcat(p,"/",len);
1667.   #endif
1668.   	BUF_strlcat(p,OPENSSL_CONF,len);

crypto/buffer/buf_str.c:115:1: start of procedure BUF_strlcat()
  113.   	}
  114.   
  115. > size_t BUF_strlcat(char *dst, const char *src, size_t size)
  116.   	{
  117.   	size_t l = 0;

crypto/buffer/buf_str.c:117:2: 
  115.   size_t BUF_strlcat(char *dst, const char *src, size_t size)
  116.   	{
  117. > 	size_t l = 0;
  118.   	for(; size > 0 && *dst; size--, dst++)
  119.   		l++;

crypto/buffer/buf_str.c:118:8: Loop condition is true. Entering loop body
  116.   	{
  117.   	size_t l = 0;
  118.   	for(; size > 0 && *dst; size--, dst++)
                ^
  119.   		l++;
  120.   	return l + BUF_strlcpy(dst, src, size);

crypto/buffer/buf_str.c:118:20: Loop condition is false. Leaving loop
  116.   	{
  117.   	size_t l = 0;
  118.   	for(; size > 0 && *dst; size--, dst++)
                            ^
  119.   		l++;
  120.   	return l + BUF_strlcpy(dst, src, size);
