crypto/ui/ui_lib.c:625: error: NULL_DEREFERENCE
  pointer `ui_method` last assigned on line 621 could be null and is dereferenced at line 625, column 2.
Showing all 38 steps of the trace


crypto/ui/ui_lib.c:619:1: start of procedure UI_create_method()
617.   
618.   
619. > UI_METHOD *UI_create_method(char *name)
620.   	{
621.   	UI_METHOD *ui_method = (UI_METHOD *)OPENSSL_malloc(sizeof(UI_METHOD));

crypto/ui/ui_lib.c:621:2: 
619.   UI_METHOD *UI_create_method(char *name)
620.   	{
621. > 	UI_METHOD *ui_method = (UI_METHOD *)OPENSSL_malloc(sizeof(UI_METHOD));
622.   
623.   	if (ui_method)

crypto/mem.c:282:1: start of procedure CRYPTO_malloc()
  280.   	}
  281.   
  282. > void *CRYPTO_malloc(int num, const char *file, int line)
  283.   	{
  284.   	void *ret = NULL;

crypto/mem.c:284:2: 
  282.   void *CRYPTO_malloc(int num, const char *file, int line)
  283.   	{
  284. > 	void *ret = NULL;
  285.   
  286.   	allow_customize = 0;

crypto/mem.c:286:2: 
  284.   	void *ret = NULL;
  285.   
  286. > 	allow_customize = 0;
  287.   	if (malloc_debug_func != NULL)
  288.   		{

crypto/mem.c:287:6: Taking false branch
  285.   
  286.   	allow_customize = 0;
  287.   	if (malloc_debug_func != NULL)
              ^
  288.   		{
  289.   		allow_customize_debug = 0;

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

crypto/mem.c:296:6: Taking false branch
  294.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
  295.   #endif
  296.   	if (malloc_debug_func != NULL)
              ^
  297.   		malloc_debug_func(ret, num, file, line, 1);
  298.   

crypto/mem.c:299:2: 
  297.   		malloc_debug_func(ret, num, file, line, 1);
  298.   
  299. > 	return ret;
  300.   	}
  301.   

crypto/mem.c:300:2: return from a call to CRYPTO_malloc
  298.   
  299.   	return ret;
  300.   	}
          ^
  301.   
  302.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/ui/ui_lib.c:623:6: Taking false branch
621.   	UI_METHOD *ui_method = (UI_METHOD *)OPENSSL_malloc(sizeof(UI_METHOD));
622.   
623.   	if (ui_method)
            ^
624.   		memset(ui_method, 0, sizeof(*ui_method));
625.   	ui_method->name = BUF_strdup(name);

crypto/ui/ui_lib.c:625:2: 
623.   	if (ui_method)
624.   		memset(ui_method, 0, sizeof(*ui_method));
625. > 	ui_method->name = BUF_strdup(name);
626.   	return ui_method;
627.   	}

crypto/buffer/buffer.c:127:1: start of procedure BUF_strdup()
  125.   	}
  126.   
  127. > char *BUF_strdup(const char *str)
  128.   	{
  129.   	char *ret;

crypto/buffer/buffer.c:132:6: Taking false branch
  130.   	int n;
  131.   
  132.   	if (str == NULL) return(NULL);
              ^
  133.   
  134.   	n=strlen(str);

crypto/buffer/buffer.c:134:2: 
  132.   	if (str == NULL) return(NULL);
  133.   
  134. > 	n=strlen(str);
  135.   	ret=OPENSSL_malloc(n+1);
  136.   	if (ret == NULL) 

crypto/buffer/buffer.c:135:2: 
  133.   
  134.   	n=strlen(str);
  135. > 	ret=OPENSSL_malloc(n+1);
  136.   	if (ret == NULL) 
  137.   		{

crypto/mem.c:282:1: start of procedure CRYPTO_malloc()
    280.   	}
    281.   
    282. > void *CRYPTO_malloc(int num, const char *file, int line)
    283.   	{
    284.   	void *ret = NULL;

crypto/mem.c:284:2: 
    282.   void *CRYPTO_malloc(int num, const char *file, int line)
    283.   	{
    284. > 	void *ret = NULL;
    285.   
    286.   	allow_customize = 0;

crypto/mem.c:286:2: 
    284.   	void *ret = NULL;
    285.   
    286. > 	allow_customize = 0;
    287.   	if (malloc_debug_func != NULL)
    288.   		{

crypto/mem.c:287:6: Taking false branch
    285.   
    286.   	allow_customize = 0;
    287.   	if (malloc_debug_func != NULL)
                ^
    288.   		{
    289.   		allow_customize_debug = 0;

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

crypto/mem.c:296:6: Taking false branch
    294.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
    295.   #endif
    296.   	if (malloc_debug_func != NULL)
                ^
    297.   		malloc_debug_func(ret, num, file, line, 1);
    298.   

crypto/mem.c:299:2: 
    297.   		malloc_debug_func(ret, num, file, line, 1);
    298.   
    299. > 	return ret;
    300.   	}
    301.   

crypto/mem.c:300:2: return from a call to CRYPTO_malloc
    298.   
    299.   	return ret;
    300.   	}
            ^
    301.   
    302.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/buffer/buffer.c:136:6: Taking true branch
  134.   	n=strlen(str);
  135.   	ret=OPENSSL_malloc(n+1);
  136.   	if (ret == NULL) 
              ^
  137.   		{
  138.   		BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);

crypto/buffer/buffer.c:138:3: 
  136.   	if (ret == NULL) 
  137.   		{
  138. > 		BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);
  139.   		return(NULL);
  140.   		}

crypto/err/err.c:357:1: start of procedure ERR_put_error()
    355.   /********************************************************/
    356.   
    357. > void ERR_put_error(int lib, int func, int reason, const char *file,
    358.   	     int line)
    359.   	{

crypto/err/err.c:381:2: Skipping ERR_get_state(): empty list of specs
    379.   	}
    380.   #endif
    381.   	es=ERR_get_state();
            ^
    382.   
    383.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:383:2: 
    381.   	es=ERR_get_state();
    382.   
    383. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    384.   	if (es->top == es->bottom)
    385.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:384:6: Taking false branch
    382.   
    383.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    384.   	if (es->top == es->bottom)
                ^
    385.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    386.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:386:2: 
    384.   	if (es->top == es->bottom)
    385.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    386. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    387.   	es->err_file[es->top]=file;
    388.   	es->err_line[es->top]=line;

crypto/err/err.c:387:2: 
    385.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    386.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    387. > 	es->err_file[es->top]=file;
    388.   	es->err_line[es->top]=line;
    389.   	err_clear_data(es,es->top);

crypto/err/err.c:388:2: 
    386.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    387.   	es->err_file[es->top]=file;
    388. > 	es->err_line[es->top]=line;
    389.   	err_clear_data(es,es->top);
    390.   	}

crypto/err/err.c:389:2: Taking true branch
    387.   	es->err_file[es->top]=file;
    388.   	es->err_line[es->top]=line;
    389.   	err_clear_data(es,es->top);
            ^
    390.   	}
    391.   

crypto/err/err.c:389:2: Taking false branch
    387.   	es->err_file[es->top]=file;
    388.   	es->err_line[es->top]=line;
    389.   	err_clear_data(es,es->top);
            ^
    390.   	}
    391.   

crypto/err/err.c:390:2: return from a call to ERR_put_error
    388.   	es->err_line[es->top]=line;
    389.   	err_clear_data(es,es->top);
    390.   	}
            ^
    391.   
    392.   void ERR_clear_error(void)

crypto/buffer/buffer.c:139:3: 
  137.   		{
  138.   		BUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);
  139. > 		return(NULL);
  140.   		}
  141.   	memcpy(ret,str,n+1);

crypto/buffer/buffer.c:143:2: return from a call to BUF_strdup
  141.   	memcpy(ret,str,n+1);
  142.   	return(ret);
  143.   	}
          ^
  144.   

UI_METHOD *UI_create_method(char *name)
	{
	UI_METHOD *ui_method = (UI_METHOD *)OPENSSL_malloc(sizeof(UI_METHOD));
	if (ui_method)
		memset(ui_method, 0, sizeof(*ui_method));
	ui_method->name = BUF_strdup(name);
	return ui_method;
	}
['UI_METHOD *UI_create_method(char *name)\n\t{\n\tUI_METHOD *ui_method = (UI_METHOD *)OPENSSL_malloc(sizeof(UI_METHOD));\n\tif (ui_method)\n\t\tmemset(ui_method, 0, sizeof(*ui_method));\n\tui_method->name = BUF_strdup(name);\n\treturn ui_method;\n\t}', 'void *CRYPTO_malloc(int num, const char *file, int line)\n\t{\n\tvoid *ret = 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\treturn ret;\n\t}', 'char *BUF_strdup(const char *str)\n\t{\n\tchar *ret;\n\tint n;\n\tif (str == NULL) return(NULL);\n\tn=strlen(str);\n\tret=OPENSSL_malloc(n+1);\n\tif (ret == NULL)\n\t\t{\n\t\tBUFerr(BUF_F_BUF_STRDUP,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tmemcpy(ret,str,n+1);\n\treturn(ret);\n\t}', 'void ERR_put_error(int lib, int func, int reason, const char *file,\n\t     int line)\n\t{\n\tERR_STATE *es;\n#ifdef _OSD_POSIX\n\tif (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) {\n\t\tchar *end;\n\t\tfile += sizeof("*POSIX(")-1;\n\t\tend = &file[strlen(file)-1];\n\t\tif (*end == \')\')\n\t\t\t*end = \'\\0\';\n\t\tif ((end = strrchr(file, \'/\')) != NULL)\n\t\t\tfile = &end[1];\n\t}\n#endif\n\tes=ERR_get_state();\n\tes->top=(es->top+1)%ERR_NUM_ERRORS;\n\tif (es->top == es->bottom)\n\t\tes->bottom=(es->bottom+1)%ERR_NUM_ERRORS;\n\tes->err_buffer[es->top]=ERR_PACK(lib,func,reason);\n\tes->err_file[es->top]=file;\n\tes->err_line[es->top]=line;\n\terr_clear_data(es,es->top);\n\t}']