engines/ccgost/gost_pmeth.c:283: error: NULL_DEREFERENCE
  pointer `dsa` last assigned on line 277 could be null and is dereferenced by call to `gost_sign_keygen()` at line 283, column 2.
Showing all 44 steps of the trace


engines/ccgost/gost_pmeth.c:260:1: start of procedure pkey_gost94_keygen()
258.   /* --------------------- key generation  --------------------------------*/
259.   /* Generates GOST 94 key and assigns it setting specified type */
260. > static int pkey_gost94_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey,int type)
261.   	{
262.   	struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);

engines/ccgost/gost_pmeth.c:262:2: 
260.   static int pkey_gost94_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey,int type)
261.   	{
262. > 	struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);
263.   	DSA *dsa=NULL;
264.   	if (data->sign_param_nid == NID_undef)

crypto/evp/pmeth_lib.c:379:1: start of procedure EVP_PKEY_CTX_get_data()
  377.   	}
  378.   
  379. > void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx)
  380.   	{
  381.   	return ctx->data;

crypto/evp/pmeth_lib.c:381:2: 
  379.   void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx)
  380.   	{
  381. > 	return ctx->data;
  382.   	}
  383.   

crypto/evp/pmeth_lib.c:382:2: return from a call to EVP_PKEY_CTX_get_data
  380.   	{
  381.   	return ctx->data;
  382.   	}
          ^
  383.   
  384.   EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx)

engines/ccgost/gost_pmeth.c:263:2: 
261.   	{
262.   	struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);
263. > 	DSA *dsa=NULL;
264.   	if (data->sign_param_nid == NID_undef)
265.   		{

engines/ccgost/gost_pmeth.c:264:6: Taking false branch
262.   	struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);
263.   	DSA *dsa=NULL;
264.   	if (data->sign_param_nid == NID_undef)
            ^
265.   		{
266.   		if (type== NID_id_GostR3410_94_cc)

engines/ccgost/gost_pmeth.c:277:2: 
275.   			}	
276.   		}
277. > 	dsa = DSA_new();
278.   	if (!fill_GOST94_params(dsa,data->sign_param_nid))
279.   		{

crypto/dsa/dsa_lib.c:89:1: start of procedure DSA_new()
  87.   	}
  88.   
  89. > DSA *DSA_new(void)
  90.   	{
  91.   	return DSA_new_method(NULL);

crypto/dsa/dsa_lib.c:91:2: 
  89.   DSA *DSA_new(void)
  90.   	{
  91. > 	return DSA_new_method(NULL);
  92.   	}
  93.   

crypto/dsa/dsa_lib.c:113:1: start of procedure DSA_new_method()
    111.   	}
    112.   
    113. > DSA *DSA_new_method(ENGINE *engine)
    114.   	{
    115.   	DSA *ret;

crypto/dsa/dsa_lib.c:117:2: 
    115.   	DSA *ret;
    116.   
    117. > 	ret=(DSA *)OPENSSL_malloc(sizeof(DSA));
    118.   	if (ret == NULL)
    119.   		{

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/dsa/dsa_lib.c:118:6: Taking true branch
    116.   
    117.   	ret=(DSA *)OPENSSL_malloc(sizeof(DSA));
    118.   	if (ret == NULL)
                ^
    119.   		{
    120.   		DSAerr(DSA_F_DSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);

crypto/dsa/dsa_lib.c:120:3: 
    118.   	if (ret == NULL)
    119.   		{
    120. > 		DSAerr(DSA_F_DSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);
    121.   		return(NULL);
    122.   		}

crypto/err/err.c:679:1: start of procedure ERR_put_error()
      677.   /********************************************************/
      678.   
      679. > void ERR_put_error(int lib, int func, int reason, const char *file,
      680.   	     int line)
      681.   	{

crypto/err/err.c:703:2: Skipping ERR_get_state(): empty list of specs
      701.   	}
      702.   #endif
      703.   	es=ERR_get_state();
              ^
      704.   
      705.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:705:2: 
      703.   	es=ERR_get_state();
      704.   
      705. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
      706.   	if (es->top == es->bottom)
      707.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:706:6: Taking false branch
      704.   
      705.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
      706.   	if (es->top == es->bottom)
                  ^
      707.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      708.   	es->err_flags[es->top]=0;

crypto/err/err.c:708:2: 
      706.   	if (es->top == es->bottom)
      707.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      708. > 	es->err_flags[es->top]=0;
      709.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      710.   	es->err_file[es->top]=file;

crypto/err/err.c:709:2: 
      707.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      708.   	es->err_flags[es->top]=0;
      709. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      710.   	es->err_file[es->top]=file;
      711.   	es->err_line[es->top]=line;

crypto/err/err.c:710:2: 
      708.   	es->err_flags[es->top]=0;
      709.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      710. > 	es->err_file[es->top]=file;
      711.   	es->err_line[es->top]=line;
      712.   	err_clear_data(es,es->top);

crypto/err/err.c:711:2: 
      709.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      710.   	es->err_file[es->top]=file;
      711. > 	es->err_line[es->top]=line;
      712.   	err_clear_data(es,es->top);
      713.   	}

crypto/err/err.c:712:2: Taking true branch
      710.   	es->err_file[es->top]=file;
      711.   	es->err_line[es->top]=line;
      712.   	err_clear_data(es,es->top);
              ^
      713.   	}
      714.   

crypto/err/err.c:712:2: Taking false branch
      710.   	es->err_file[es->top]=file;
      711.   	es->err_line[es->top]=line;
      712.   	err_clear_data(es,es->top);
              ^
      713.   	}
      714.   

crypto/err/err.c:712:2: Loop condition is false. Leaving loop
      710.   	es->err_file[es->top]=file;
      711.   	es->err_line[es->top]=line;
      712.   	err_clear_data(es,es->top);
              ^
      713.   	}
      714.   

crypto/err/err.c:713:2: return from a call to ERR_put_error
      711.   	es->err_line[es->top]=line;
      712.   	err_clear_data(es,es->top);
      713.   	}
              ^
      714.   
      715.   void ERR_clear_error(void)

crypto/dsa/dsa_lib.c:121:3: 
    119.   		{
    120.   		DSAerr(DSA_F_DSA_NEW_METHOD,ERR_R_MALLOC_FAILURE);
    121. > 		return(NULL);
    122.   		}
    123.   	ret->meth = DSA_get_default_method();

crypto/dsa/dsa_lib.c:180:2: return from a call to DSA_new_method
    178.   	
    179.   	return(ret);
    180.   	}
            ^
    181.   
    182.   void DSA_free(DSA *r)

crypto/dsa/dsa_lib.c:92:2: return from a call to DSA_new
  90.   	{
  91.   	return DSA_new_method(NULL);
  92.   	}
         ^
  93.   
  94.   int DSA_set_method(DSA *dsa, const DSA_METHOD *meth)

engines/ccgost/gost_pmeth.c:278:7: Taking false branch
276.   		}
277.   	dsa = DSA_new();
278.   	if (!fill_GOST94_params(dsa,data->sign_param_nid))
             ^
279.   		{
280.   		DSA_free(dsa);

engines/ccgost/gost_pmeth.c:283:2: 
281.   		return 0;
282.   		}
283. > 	gost_sign_keygen(dsa);
284.   	EVP_PKEY_assign(pkey,type,dsa);
285.   	return 1;
