crypto/mem.c:331: error: NULL_DEREFERENCE
  pointer `ret` last assigned on line 329 could be null and is dereferenced by call to `strcpy()` at line 331, column 2.
Showing all 16 steps of the trace


crypto/mem.c:327:1: start of procedure CRYPTO_strdup()
325.   	return ret;
326.   	}
327. > char *CRYPTO_strdup(const char *str, const char *file, int line)
328.   	{
329.   	char *ret = CRYPTO_malloc(strlen(str)+1, file, line);

crypto/mem.c:329:2: 
327.   char *CRYPTO_strdup(const char *str, const char *file, int line)
328.   	{
329. > 	char *ret = CRYPTO_malloc(strlen(str)+1, file, line);
330.   
331.   	strcpy(ret, str);

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

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

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

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

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

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

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

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

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

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

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

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

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

crypto/mem.c:331:2: 
329.   	char *ret = CRYPTO_malloc(strlen(str)+1, file, line);
330.   
331. > 	strcpy(ret, str);
332.   	return ret;
333.   	}
