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


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

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

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)

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

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

crypto/buffer/buffer.c:165:1: start of procedure BUF_strdup()
  163.   	}
  164.   
  165. > char *BUF_strdup(const char *str)
  166.   	{
  167.   	if (str == NULL) return(NULL);

crypto/buffer/buffer.c:167:6: Taking false branch
  165.   char *BUF_strdup(const char *str)
  166.   	{
  167.   	if (str == NULL) return(NULL);
              ^
  168.   	return BUF_strndup(str, strlen(str));
  169.   	}

crypto/buffer/buffer.c:168:2: 
  166.   	{
  167.   	if (str == NULL) return(NULL);
  168. > 	return BUF_strndup(str, strlen(str));
  169.   	}
  170.   

crypto/buffer/buffer.c:171:1: start of procedure BUF_strndup()
    169.   	}
    170.   
    171. > char *BUF_strndup(const char *str, size_t siz)
    172.   	{
    173.   	char *ret;

crypto/buffer/buffer.c:175:6: Taking false branch
    173.   	char *ret;
    174.   
    175.   	if (str == NULL) return(NULL);
                ^
    176.   
    177.   	ret=OPENSSL_malloc(siz+1);

crypto/buffer/buffer.c:177:2: 
    175.   	if (str == NULL) return(NULL);
    176.   
    177. > 	ret=OPENSSL_malloc(siz+1);
    178.   	if (ret == NULL) 
    179.   		{

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)

crypto/buffer/buffer.c:178:6: Taking true branch
    176.   
    177.   	ret=OPENSSL_malloc(siz+1);
    178.   	if (ret == NULL) 
                ^
    179.   		{
    180.   		BUFerr(BUF_F_BUF_STRNDUP,ERR_R_MALLOC_FAILURE);

crypto/buffer/buffer.c:180:3: 
    178.   	if (ret == NULL) 
    179.   		{
    180. > 		BUFerr(BUF_F_BUF_STRNDUP,ERR_R_MALLOC_FAILURE);
    181.   		return(NULL);
    182.   		}

crypto/err/err.c:630:1: start of procedure ERR_put_error()
      628.   /********************************************************/
      629.   
      630. > void ERR_put_error(int lib, int func, int reason, const char *file,
      631.   	     int line)
      632.   	{

crypto/err/err.c:654:2: Skipping ERR_get_state(): empty list of specs
      652.   	}
      653.   #endif
      654.   	es=ERR_get_state();
              ^
      655.   
      656.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:656:2: 
      654.   	es=ERR_get_state();
      655.   
      656. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
      657.   	if (es->top == es->bottom)
      658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:657:6: Taking false branch
      655.   
      656.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
      657.   	if (es->top == es->bottom)
                  ^
      658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      659.   	es->err_flags[es->top]=0;

crypto/err/err.c:659:2: 
      657.   	if (es->top == es->bottom)
      658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      659. > 	es->err_flags[es->top]=0;
      660.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      661.   	es->err_file[es->top]=file;

crypto/err/err.c:660:2: 
      658.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      659.   	es->err_flags[es->top]=0;
      660. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      661.   	es->err_file[es->top]=file;
      662.   	es->err_line[es->top]=line;

crypto/err/err.c:661:2: 
      659.   	es->err_flags[es->top]=0;
      660.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      661. > 	es->err_file[es->top]=file;
      662.   	es->err_line[es->top]=line;
      663.   	err_clear_data(es,es->top);

crypto/err/err.c:662:2: 
      660.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      661.   	es->err_file[es->top]=file;
      662. > 	es->err_line[es->top]=line;
      663.   	err_clear_data(es,es->top);
      664.   	}

crypto/err/err.c:663:2: Taking true branch
      661.   	es->err_file[es->top]=file;
      662.   	es->err_line[es->top]=line;
      663.   	err_clear_data(es,es->top);
              ^
      664.   	}
      665.   

crypto/err/err.c:663:2: Taking false branch
      661.   	es->err_file[es->top]=file;
      662.   	es->err_line[es->top]=line;
      663.   	err_clear_data(es,es->top);
              ^
      664.   	}
      665.   

crypto/err/err.c:663:2: Loop condition is false. Leaving loop
      661.   	es->err_file[es->top]=file;
      662.   	es->err_line[es->top]=line;
      663.   	err_clear_data(es,es->top);
              ^
      664.   	}
      665.   

crypto/err/err.c:664:2: return from a call to ERR_put_error
      662.   	es->err_line[es->top]=line;
      663.   	err_clear_data(es,es->top);
      664.   	}
              ^
      665.   
      666.   void ERR_clear_error(void)

crypto/buffer/buffer.c:181:3: 
    179.   		{
    180.   		BUFerr(BUF_F_BUF_STRNDUP,ERR_R_MALLOC_FAILURE);
    181. > 		return(NULL);
    182.   		}
    183.   	BUF_strlcpy(ret,str,siz+1);

crypto/buffer/buffer.c:185:2: return from a call to BUF_strndup
    183.   	BUF_strlcpy(ret,str,siz+1);
    184.   	return(ret);
    185.   	}
            ^
    186.   
    187.   void *BUF_memdup(const void *data, size_t siz)

crypto/buffer/buffer.c:169:2: return from a call to BUF_strdup
  167.   	if (str == NULL) return(NULL);
  168.   	return BUF_strndup(str, strlen(str));
  169.   	}
          ^
  170.   
  171.   char *BUF_strndup(const char *str, size_t siz)

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\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}', 'char *BUF_strdup(const char *str)\n\t{\n\tif (str == NULL) return(NULL);\n\treturn BUF_strndup(str, strlen(str));\n\t}', 'char *BUF_strndup(const char *str, size_t siz)\n\t{\n\tchar *ret;\n\tif (str == NULL) return(NULL);\n\tret=OPENSSL_malloc(siz+1);\n\tif (ret == NULL)\n\t\t{\n\t\tBUFerr(BUF_F_BUF_STRNDUP,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tBUF_strlcpy(ret,str,siz+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_flags[es->top]=0;\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}']