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


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

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

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

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

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

crypto/mem.c:301:16: 
  299.   	void *ret = NULL;
  300.   
  301. > 	if (num <= 0) return NULL;
  302.   
  303.   	if(allow_customize)

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

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

char *CRYPTO_strdup(const char *str, const char *file, int line)
	{
	char *ret = CRYPTO_malloc(strlen(str)+1, file, line);
	strcpy(ret, str);
	return ret;
	}
['char *CRYPTO_strdup(const char *str, const char *file, int line)\n\t{\n\tchar *ret = CRYPTO_malloc(strlen(str)+1, file, line);\n\tstrcpy(ret, str);\n\treturn ret;\n\t}', 'void *CRYPTO_malloc(int num, const char *file, int line)\n\t{\n\tvoid *ret = NULL;\n\tif (num <= 0) return NULL;\n\tif(allow_customize)\n\t\tallow_customize = 0;\n\tif (malloc_debug_func != NULL)\n\t\t{\n\t\tif(allow_customize_debug)\n\t\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#ifndef OPENSSL_CPUID_OBJ\n        if(ret && (num > 2048))\n\t{\textern unsigned char cleanse_ctr;\n                ((unsigned char *)ret)[0] = cleanse_ctr;\n\t}\n#endif\n\treturn ret;\n\t}']