engines/ccgost/gost_sign.c:204: error: NULL_DEREFERENCE
  pointer `dsa->pub_key` last assigned on line 203 could be null and is dereferenced by call to `BN_mod_exp()` at line 204, column 2.
Showing all 99 steps of the trace


engines/ccgost/gost_sign.c:193:1: start of procedure gost94_compute_public()
191.    *
192.    */
193. > int gost94_compute_public(DSA *dsa)
194.   	{
195.   	/* Now fill algorithm parameters with correct values */

engines/ccgost/gost_sign.c:196:2: 
194.   	{
195.   	/* Now fill algorithm parameters with correct values */
196. > 	BN_CTX *ctx = BN_CTX_new();
197.   	if (!dsa->g)
198.   		{

crypto/bn/bn_ctx.c:214:1: start of procedure BN_CTX_new()
  212.   #endif
  213.   
  214. > BN_CTX *BN_CTX_new(void)
  215.   	{
  216.   	BN_CTX *ret = OPENSSL_malloc(sizeof(BN_CTX));

crypto/bn/bn_ctx.c:216:2: 
  214.   BN_CTX *BN_CTX_new(void)
  215.   	{
  216. > 	BN_CTX *ret = OPENSSL_malloc(sizeof(BN_CTX));
  217.   	if(!ret)
  218.   		{

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/bn/bn_ctx.c:217:6: Taking true branch
  215.   	{
  216.   	BN_CTX *ret = OPENSSL_malloc(sizeof(BN_CTX));
  217.   	if(!ret)
              ^
  218.   		{
  219.   		BNerr(BN_F_BN_CTX_NEW,ERR_R_MALLOC_FAILURE);

crypto/bn/bn_ctx.c:219:3: 
  217.   	if(!ret)
  218.   		{
  219. > 		BNerr(BN_F_BN_CTX_NEW,ERR_R_MALLOC_FAILURE);
  220.   		return NULL;
  221.   		}

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/bn/bn_ctx.c:220:3: 
  218.   		{
  219.   		BNerr(BN_F_BN_CTX_NEW,ERR_R_MALLOC_FAILURE);
  220. > 		return NULL;
  221.   		}
  222.   	/* Initialise the structure */

crypto/bn/bn_ctx.c:229:2: return from a call to BN_CTX_new
  227.   	ret->too_many = 0;
  228.   	return ret;
  229.   	}
          ^
  230.   
  231.   void BN_CTX_free(BN_CTX *ctx)

engines/ccgost/gost_sign.c:197:7: Taking false branch
195.   	/* Now fill algorithm parameters with correct values */
196.   	BN_CTX *ctx = BN_CTX_new();
197.   	if (!dsa->g)
             ^
198.   		{
199.   		GOSTerr(GOST_F_GOST_COMPUTE_PUBLIC,GOST_R_KEY_IS_NOT_INITALIZED);

engines/ccgost/gost_sign.c:203:2: 
201.   		}	
202.   	/* Compute public key  y = a^x mod p */
203. > 	dsa->pub_key=BN_new();
204.   	BN_mod_exp(dsa->pub_key, dsa->g,dsa->priv_key,dsa->p,ctx);
205.   	BN_CTX_free(ctx);

crypto/bn/bn_lib.c:298:1: start of procedure BN_new()
  296.   	}
  297.   
  298. > BIGNUM *BN_new(void)
  299.   	{
  300.   	BIGNUM *ret;

crypto/bn/bn_lib.c:302:6: 
  300.   	BIGNUM *ret;
  301.   
  302. > 	if ((ret=(BIGNUM *)OPENSSL_malloc(sizeof(BIGNUM))) == NULL)
  303.   		{
  304.   		BNerr(BN_F_BN_NEW,ERR_R_MALLOC_FAILURE);

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/bn/bn_lib.c:302:6: Taking true branch
  300.   	BIGNUM *ret;
  301.   
  302.   	if ((ret=(BIGNUM *)OPENSSL_malloc(sizeof(BIGNUM))) == NULL)
              ^
  303.   		{
  304.   		BNerr(BN_F_BN_NEW,ERR_R_MALLOC_FAILURE);

crypto/bn/bn_lib.c:304:3: 
  302.   	if ((ret=(BIGNUM *)OPENSSL_malloc(sizeof(BIGNUM))) == NULL)
  303.   		{
  304. > 		BNerr(BN_F_BN_NEW,ERR_R_MALLOC_FAILURE);
  305.   		return(NULL);
  306.   		}

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/bn/bn_lib.c:305:3: 
  303.   		{
  304.   		BNerr(BN_F_BN_NEW,ERR_R_MALLOC_FAILURE);
  305. > 		return(NULL);
  306.   		}
  307.   	ret->flags=BN_FLG_MALLOCED;

crypto/bn/bn_lib.c:314:2: return from a call to BN_new
  312.   	bn_check_top(ret);
  313.   	return(ret);
  314.   	}
          ^
  315.   
  316.   /* This is used both by bn_expand2() and bn_dup_expand() */

engines/ccgost/gost_sign.c:204:2: 
202.   	/* Compute public key  y = a^x mod p */
203.   	dsa->pub_key=BN_new();
204. > 	BN_mod_exp(dsa->pub_key, dsa->g,dsa->priv_key,dsa->p,ctx);
205.   	BN_CTX_free(ctx);
206.   	return 1;

crypto/bn/bn_exp.c:163:1: start of procedure BN_mod_exp()
  161.   
  162.   
  163. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
  164.   	       BN_CTX *ctx)
  165.   	{

crypto/bn/bn_exp.c:213:6: Taking false branch
  211.   /*	if ((m->d[m->top-1]&BN_TBIT) && BN_is_odd(m)) */
  212.   
  213.   	if (BN_is_odd(m))
              ^
  214.   		{
  215.   #  ifdef MONT_EXP_WORD

crypto/bn/bn_exp.c:228:5: 
  226.   #endif
  227.   #ifdef RECP_MUL_MOD
  228. > 		{ ret=BN_mod_exp_recp(r,a,p,m,ctx); }
  229.   #else
  230.   		{ ret=BN_mod_exp_simple(r,a,p,m,ctx); }

crypto/bn/bn_exp.c:238:1: start of procedure BN_mod_exp_recp()
    236.   
    237.   
    238. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
    239.   		    const BIGNUM *m, BN_CTX *ctx)
    240.   	{

crypto/bn/bn_exp.c:241:2: 
    239.   		    const BIGNUM *m, BN_CTX *ctx)
    240.   	{
    241. > 	int i,j,bits,ret=0,wstart,wend,window,wvalue;
    242.   	int start=1;
    243.   	BIGNUM *aa;

crypto/bn/bn_exp.c:242:2: 
    240.   	{
    241.   	int i,j,bits,ret=0,wstart,wend,window,wvalue;
    242. > 	int start=1;
    243.   	BIGNUM *aa;
    244.   	/* Table of variables obtained from 'ctx' */

crypto/bn/bn_exp.c:248:6: Taking true branch
    246.   	BN_RECP_CTX recp;
    247.   
    248.   	if (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)
                ^
    249.   		{
    250.   		/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */

crypto/bn/bn_exp.c:251:3: 
    249.   		{
    250.   		/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
    251. > 		BNerr(BN_F_BN_MOD_EXP_RECP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
    252.   		return -1;
    253.   		}

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 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/mem.c:371:1: start of procedure CRYPTO_free()
        369.   	}
        370.   
        371. > void CRYPTO_free(void *str)
        372.   	{
        373.   	if (free_debug_func != NULL)

crypto/mem.c:373:6: Taking true branch
        371.   void CRYPTO_free(void *str)
        372.   	{
        373.   	if (free_debug_func != NULL)
                    ^
        374.   		free_debug_func(str, 0);
        375.   #ifdef LEVITTE_DEBUG_MEM

crypto/mem.c:374:3: Skipping __function_pointer__(): unresolved function pointer
        372.   	{
        373.   	if (free_debug_func != NULL)
        374.   		free_debug_func(str, 0);
                 ^
        375.   #ifdef LEVITTE_DEBUG_MEM
        376.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);

crypto/mem.c:378:2: Skipping __function_pointer__(): unresolved function pointer
        376.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);
        377.   #endif
        378.   	free_func(str);
                ^
        379.   	if (free_debug_func != NULL)
        380.   		free_debug_func(NULL, 1);

crypto/mem.c:379:6: Taking true branch
        377.   #endif
        378.   	free_func(str);
        379.   	if (free_debug_func != NULL)
                    ^
        380.   		free_debug_func(NULL, 1);
        381.   	}

crypto/mem.c:380:3: Skipping __function_pointer__(): unresolved function pointer
        378.   	free_func(str);
        379.   	if (free_debug_func != NULL)
        380.   		free_debug_func(NULL, 1);
                 ^
        381.   	}
        382.   

crypto/mem.c:379:2: 
        377.   #endif
        378.   	free_func(str);
        379. > 	if (free_debug_func != NULL)
        380.   		free_debug_func(NULL, 1);
        381.   	}

crypto/mem.c:381:2: return from a call to CRYPTO_free
        379.   	if (free_debug_func != NULL)
        380.   		free_debug_func(NULL, 1);
        381.   	}
                ^
        382.   
        383.   void *CRYPTO_remalloc(void *a, int num, const char *file, int line)

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/bn/bn_exp.c:252:3: 
    250.   		/* BN_FLG_EXP_CONSTTIME only supported by BN_mod_exp_mont() */
    251.   		BNerr(BN_F_BN_MOD_EXP_RECP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
    252. > 		return -1;
    253.   		}
    254.   

crypto/bn/bn_exp.c:368:2: return from a call to BN_mod_exp_recp
    366.   	bn_check_top(r);
    367.   	return(ret);
    368.   	}
            ^
    369.   
    370.   

crypto/bn/bn_exp.c:234:2: 
  232.   
  233.   	bn_check_top(r);
  234. > 	return(ret);
  235.   	}
  236.   

crypto/bn/bn_exp.c:235:2: return from a call to BN_mod_exp
  233.   	bn_check_top(r);
  234.   	return(ret);
  235.   	}
          ^
  236.   
  237.   

int gost94_compute_public(DSA *dsa)
	{
	BN_CTX *ctx = BN_CTX_new();
	if (!dsa->g)
		{
		GOSTerr(GOST_F_GOST_COMPUTE_PUBLIC,GOST_R_KEY_IS_NOT_INITALIZED);
		return 0;
		}
	dsa->pub_key=BN_new();
	BN_mod_exp(dsa->pub_key, dsa->g,dsa->priv_key,dsa->p,ctx);
	BN_CTX_free(ctx);
	return 1;
	}
['int gost94_compute_public(DSA *dsa)\n\t{\n\tBN_CTX *ctx = BN_CTX_new();\n\tif (!dsa->g)\n\t\t{\n\t\tGOSTerr(GOST_F_GOST_COMPUTE_PUBLIC,GOST_R_KEY_IS_NOT_INITALIZED);\n\t\treturn 0;\n\t\t}\n\tdsa->pub_key=BN_new();\n\tBN_mod_exp(dsa->pub_key, dsa->g,dsa->priv_key,dsa->p,ctx);\n\tBN_CTX_free(ctx);\n\treturn 1;\n\t}', 'BN_CTX *BN_CTX_new(void)\n\t{\n\tBN_CTX *ret = OPENSSL_malloc(sizeof(BN_CTX));\n\tif(!ret)\n\t\t{\n\t\tBNerr(BN_F_BN_CTX_NEW,ERR_R_MALLOC_FAILURE);\n\t\treturn NULL;\n\t\t}\n\tBN_POOL_init(&ret->pool);\n\tBN_STACK_init(&ret->stack);\n\tret->used = 0;\n\tret->err_stack = 0;\n\tret->too_many = 0;\n\treturn ret;\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}', '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}', 'BIGNUM *BN_new(void)\n\t{\n\tBIGNUM *ret;\n\tif ((ret=(BIGNUM *)OPENSSL_malloc(sizeof(BIGNUM))) == NULL)\n\t\t{\n\t\tBNerr(BN_F_BN_NEW,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tret->flags=BN_FLG_MALLOCED;\n\tret->top=0;\n\tret->neg=0;\n\tret->dmax=0;\n\tret->d=NULL;\n\tbn_check_top(ret);\n\treturn(ret);\n\t}', 'int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,\n\t       BN_CTX *ctx)\n\t{\n\tint ret;\n\tbn_check_top(a);\n\tbn_check_top(p);\n\tbn_check_top(m);\n#define MONT_MUL_MOD\n#define MONT_EXP_WORD\n#define RECP_MUL_MOD\n#ifdef MONT_MUL_MOD\n\tif (BN_is_odd(m))\n\t\t{\n#  ifdef MONT_EXP_WORD\n\t\tif (a->top == 1 && !a->neg && (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) == 0))\n\t\t\t{\n\t\t\tBN_ULONG A = a->d[0];\n\t\t\tret=BN_mod_exp_mont_word(r,A,p,m,ctx,NULL);\n\t\t\t}\n\t\telse\n#  endif\n\t\t\tret=BN_mod_exp_mont(r,a,p,m,ctx,NULL);\n\t\t}\n\telse\n#endif\n#ifdef RECP_MUL_MOD\n\t\t{ ret=BN_mod_exp_recp(r,a,p,m,ctx); }\n#else\n\t\t{ ret=BN_mod_exp_simple(r,a,p,m,ctx); }\n#endif\n\tbn_check_top(r);\n\treturn(ret);\n\t}', 'int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,\n\t\t    const BIGNUM *m, BN_CTX *ctx)\n\t{\n\tint i,j,bits,ret=0,wstart,wend,window,wvalue;\n\tint start=1;\n\tBIGNUM *aa;\n\tBIGNUM *val[TABLE_SIZE];\n\tBN_RECP_CTX recp;\n\tif (BN_get_flags(p, BN_FLG_EXP_CONSTTIME) != 0)\n\t\t{\n\t\tBNerr(BN_F_BN_MOD_EXP_RECP,ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);\n\t\treturn -1;\n\t\t}\n\tbits=BN_num_bits(p);\n\tif (bits == 0)\n\t\t{\n\t\tret = BN_one(r);\n\t\treturn ret;\n\t\t}\n\tBN_CTX_start(ctx);\n\taa = BN_CTX_get(ctx);\n\tval[0] = BN_CTX_get(ctx);\n\tif(!aa || !val[0]) goto err;\n\tBN_RECP_CTX_init(&recp);\n\tif (m->neg)\n\t\t{\n\t\tif (!BN_copy(aa, m)) goto err;\n\t\taa->neg = 0;\n\t\tif (BN_RECP_CTX_set(&recp,aa,ctx) <= 0) goto err;\n\t\t}\n\telse\n\t\t{\n\t\tif (BN_RECP_CTX_set(&recp,m,ctx) <= 0) goto err;\n\t\t}\n\tif (!BN_nnmod(val[0],a,m,ctx)) goto err;\n\tif (BN_is_zero(val[0]))\n\t\t{\n\t\tBN_zero(r);\n\t\tret = 1;\n\t\tgoto err;\n\t\t}\n\twindow = BN_window_bits_for_exponent_size(bits);\n\tif (window > 1)\n\t\t{\n\t\tif (!BN_mod_mul_reciprocal(aa,val[0],val[0],&recp,ctx))\n\t\t\tgoto err;\n\t\tj=1<<(window-1);\n\t\tfor (i=1; i<j; i++)\n\t\t\t{\n\t\t\tif(((val[i] = BN_CTX_get(ctx)) == NULL) ||\n\t\t\t\t\t!BN_mod_mul_reciprocal(val[i],val[i-1],\n\t\t\t\t\t\taa,&recp,ctx))\n\t\t\t\tgoto err;\n\t\t\t}\n\t\t}\n\tstart=1;\n\twvalue=0;\n\twstart=bits-1;\n\twend=0;\n\tif (!BN_one(r)) goto err;\n\tfor (;;)\n\t\t{\n\t\tif (BN_is_bit_set(p,wstart) == 0)\n\t\t\t{\n\t\t\tif (!start)\n\t\t\t\tif (!BN_mod_mul_reciprocal(r,r,r,&recp,ctx))\n\t\t\t\tgoto err;\n\t\t\tif (wstart == 0) break;\n\t\t\twstart--;\n\t\t\tcontinue;\n\t\t\t}\n\t\tj=wstart;\n\t\twvalue=1;\n\t\twend=0;\n\t\tfor (i=1; i<window; i++)\n\t\t\t{\n\t\t\tif (wstart-i < 0) break;\n\t\t\tif (BN_is_bit_set(p,wstart-i))\n\t\t\t\t{\n\t\t\t\twvalue<<=(i-wend);\n\t\t\t\twvalue|=1;\n\t\t\t\twend=i;\n\t\t\t\t}\n\t\t\t}\n\t\tj=wend+1;\n\t\tif (!start)\n\t\t\tfor (i=0; i<j; i++)\n\t\t\t\t{\n\t\t\t\tif (!BN_mod_mul_reciprocal(r,r,r,&recp,ctx))\n\t\t\t\t\tgoto err;\n\t\t\t\t}\n\t\tif (!BN_mod_mul_reciprocal(r,r,val[wvalue>>1],&recp,ctx))\n\t\t\tgoto err;\n\t\twstart-=wend+1;\n\t\twvalue=0;\n\t\tstart=0;\n\t\tif (wstart < 0) break;\n\t\t}\n\tret=1;\nerr:\n\tBN_CTX_end(ctx);\n\tBN_RECP_CTX_free(&recp);\n\tbn_check_top(r);\n\treturn(ret);\n\t}', 'void CRYPTO_free(void *str)\n\t{\n\tif (free_debug_func != NULL)\n\t\tfree_debug_func(str, 0);\n#ifdef LEVITTE_DEBUG_MEM\n\tfprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\\n", str);\n#endif\n\tfree_func(str);\n\tif (free_debug_func != NULL)\n\t\tfree_debug_func(NULL, 1);\n\t}']