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


engines/ccgost/gost_pmeth.c:244:1: start of procedure pkey_gost94cp_keygen()
242.   
243.   /* Generates Gost_R3410_94_cp key */
244. > static int pkey_gost94cp_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
245.   	{
246.   	struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);

engines/ccgost/gost_pmeth.c:246:2: 
244.   static int pkey_gost94cp_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
245.   	{
246. > 	struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);
247.   	DSA *dsa=NULL;
248.   	if (data->sign_param_nid == NID_undef)

crypto/evp/pmeth_lib.c:384:1: start of procedure EVP_PKEY_CTX_get_data()
  382.   	}
  383.   
  384. > void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx)
  385.   	{
  386.   	return ctx->data;

crypto/evp/pmeth_lib.c:386:2: 
  384.   void *EVP_PKEY_CTX_get_data(EVP_PKEY_CTX *ctx)
  385.   	{
  386. > 	return ctx->data;
  387.   	}
  388.   

crypto/evp/pmeth_lib.c:387:2: return from a call to EVP_PKEY_CTX_get_data
  385.   	{
  386.   	return ctx->data;
  387.   	}
          ^
  388.   
  389.   EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx)

engines/ccgost/gost_pmeth.c:247:2: 
245.   	{
246.   	struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);
247. > 	DSA *dsa=NULL;
248.   	if (data->sign_param_nid == NID_undef)
249.   		{

engines/ccgost/gost_pmeth.c:248:6: Taking false branch
246.   	struct gost_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);
247.   	DSA *dsa=NULL;
248.   	if (data->sign_param_nid == NID_undef)
            ^
249.   		{
250.   			GOSTerr(GOST_F_PKEY_GOST94CP_KEYGEN,

engines/ccgost/gost_pmeth.c:254:2: 
252.   			return 0;
253.   		}
254. > 	dsa = DSA_new();
255.   	if (!fill_GOST94_params(dsa,data->sign_param_nid))
256.   		{

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:294:1: start of procedure CRYPTO_malloc()
      292.   	}
      293.   
      294. > void *CRYPTO_malloc(int num, const char *file, int line)
      295.   	{
      296.   	void *ret = NULL;

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

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

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

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

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

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

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

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

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

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

crypto/mem.c:323:2: 
      321.   #endif
      322.   
      323. > 	return ret;
      324.   	}
      325.   

crypto/mem.c:324:2: return from a call to CRYPTO_malloc
      322.   
      323.   	return ret;
      324.   	}
              ^
      325.   
      326.   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:706:1: start of procedure ERR_put_error()
      704.   /********************************************************/
      705.   
      706. > void ERR_put_error(int lib, int func, int reason, const char *file,
      707.   	     int line)
      708.   	{

crypto/err/err.c:730:2: Skipping ERR_get_state(): empty list of specs
      728.   	}
      729.   #endif
      730.   	es=ERR_get_state();
              ^
      731.   
      732.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:732:2: 
      730.   	es=ERR_get_state();
      731.   
      732. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
      733.   	if (es->top == es->bottom)
      734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:733:6: Taking false branch
      731.   
      732.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
      733.   	if (es->top == es->bottom)
                  ^
      734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      735.   	es->err_flags[es->top]=0;

crypto/err/err.c:735:2: 
      733.   	if (es->top == es->bottom)
      734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      735. > 	es->err_flags[es->top]=0;
      736.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      737.   	es->err_file[es->top]=file;

crypto/err/err.c:736:2: 
      734.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
      735.   	es->err_flags[es->top]=0;
      736. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      737.   	es->err_file[es->top]=file;
      738.   	es->err_line[es->top]=line;

crypto/err/err.c:737:2: 
      735.   	es->err_flags[es->top]=0;
      736.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      737. > 	es->err_file[es->top]=file;
      738.   	es->err_line[es->top]=line;
      739.   	err_clear_data(es,es->top);

crypto/err/err.c:738:2: 
      736.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
      737.   	es->err_file[es->top]=file;
      738. > 	es->err_line[es->top]=line;
      739.   	err_clear_data(es,es->top);
      740.   	}

crypto/err/err.c:739:2: Taking true branch
      737.   	es->err_file[es->top]=file;
      738.   	es->err_line[es->top]=line;
      739.   	err_clear_data(es,es->top);
              ^
      740.   	}
      741.   

crypto/err/err.c:739:2: Taking false branch
      737.   	es->err_file[es->top]=file;
      738.   	es->err_line[es->top]=line;
      739.   	err_clear_data(es,es->top);
              ^
      740.   	}
      741.   

crypto/err/err.c:739:2: Loop condition is false. Leaving loop
      737.   	es->err_file[es->top]=file;
      738.   	es->err_line[es->top]=line;
      739.   	err_clear_data(es,es->top);
              ^
      740.   	}
      741.   

crypto/err/err.c:740:2: return from a call to ERR_put_error
      738.   	es->err_line[es->top]=line;
      739.   	err_clear_data(es,es->top);
      740.   	}
              ^
      741.   
      742.   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:255:7: Taking false branch
253.   		}
254.   	dsa = DSA_new();
255.   	if (!fill_GOST94_params(dsa,data->sign_param_nid))
             ^
256.   		{
257.   		DSA_free(dsa);

engines/ccgost/gost_pmeth.c:260:2: 
258.   		return 0;
259.   		}
260. > 	gost_sign_keygen(dsa);
261.   	EVP_PKEY_assign(pkey,NID_id_GostR3410_94,dsa);
262.   	return 1;
