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


apps/apps.c:1385:1: start of procedure make_config_name()
1383.   	}
1384.   
1385. > char *make_config_name()
1386.   	{
1387.   	const char *t=X509_get_default_cert_area();

apps/apps.c:1387:2: 
1385.   char *make_config_name()
1386.   	{
1387. > 	const char *t=X509_get_default_cert_area();
1388.   	char *p;
1389.   

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:1390:2: 
1388.   	char *p;
1389.   
1390. > 	p=OPENSSL_malloc(strlen(t)+strlen(OPENSSL_CONF)+2);
1391.   	strcpy(p,t);
1392.   #ifndef OPENSSL_SYS_VMS

crypto/mem.c:291:1: start of procedure CRYPTO_malloc()
  289.   	}
  290.   
  291. > void *CRYPTO_malloc(int num, const char *file, int line)
  292.   	{
  293.   	void *ret = NULL;

crypto/mem.c:293:2: 
  291.   void *CRYPTO_malloc(int num, const char *file, int line)
  292.   	{
  293. > 	void *ret = NULL;
  294.   	extern unsigned char cleanse_ctr;
  295.   

crypto/mem.c:296:6: Taking false branch
  294.   	extern unsigned char cleanse_ctr;
  295.   
  296.   	if (num < 0) return NULL;
              ^
  297.   
  298.   	allow_customize = 0;

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

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

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

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

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

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

crypto/mem.c:309:3: Skipping __function_pointer__(): unresolved function pointer
  307.   #endif
  308.   	if (malloc_debug_func != NULL)
  309.   		malloc_debug_func(ret, num, file, line, 1);
           ^
  310.   
  311.           /* Create a dependency on the value of 'cleanse_ctr' so our memory

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

crypto/mem.c:317:2: 
  315.                   ((unsigned char *)ret)[0] = cleanse_ctr;
  316.   
  317. > 	return ret;
  318.   	}
  319.   

crypto/mem.c:318:2: return from a call to CRYPTO_malloc
  316.   
  317.   	return ret;
  318.   	}
          ^
  319.   
  320.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

apps/apps.c:1391:2: 
1389.   
1390.   	p=OPENSSL_malloc(strlen(t)+strlen(OPENSSL_CONF)+2);
1391. > 	strcpy(p,t);
1392.   #ifndef OPENSSL_SYS_VMS
1393.   	strcat(p,"/");

char *make_config_name()
	{
	const char *t=X509_get_default_cert_area();
	char *p;
	p=OPENSSL_malloc(strlen(t)+strlen(OPENSSL_CONF)+2);
	strcpy(p,t);
#ifndef OPENSSL_SYS_VMS
	strcat(p,"/");
#endif
	strcat(p,OPENSSL_CONF);
	return p;
	}
['char *make_config_name()\n\t{\n\tconst char *t=X509_get_default_cert_area();\n\tchar *p;\n\tp=OPENSSL_malloc(strlen(t)+strlen(OPENSSL_CONF)+2);\n\tstrcpy(p,t);\n#ifndef OPENSSL_SYS_VMS\n\tstrcat(p,"/");\n#endif\n\tstrcat(p,OPENSSL_CONF);\n\treturn p;\n\t}', 'const char *X509_get_default_cert_area(void)\n\t{ return(X509_CERT_AREA); }', 'void *CRYPTO_malloc(int num, const char *file, int line)\n\t{\n\tvoid *ret = NULL;\n\textern unsigned char cleanse_ctr;\n\tif (num < 0) return 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_ex_func(num,file,line);\n#ifdef LEVITTE_DEBUG_MEM\n\tfprintf(stderr, "LEVITTE_DEBUG_MEM:         > 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        if(ret && (num > 2048))\n                ((unsigned char *)ret)[0] = cleanse_ctr;\n\treturn ret;\n\t}']