crypto/dh/dh_check.c:107: error: BUFFER_OVERRUN_L1
  Offset: [13, +oo] Size: 13 by call to `BN_is_prime`.
Showing all 33 steps of the trace


crypto/dh/dh_check.c:81:6: Call
79.   
80.   	*ret=0;
81.   	ctx=BN_CTX_new();
           ^
82.   	if (ctx == NULL) goto err;
83.   	q=BN_new();

crypto/bn/bn_lib.c:319:2: Call
  317.   		}
  318.   
  319.   	BN_CTX_init(ret);
          ^
  320.   	ret->flags=BN_FLG_MALLOCED;
  321.   	return(ret);

crypto/bn/bn_lib.c:327:2: Assignment
    325.   	{
    326.   	memset(ctx,0,sizeof(BN_CTX));
    327.   	ctx->tos=0;
            ^
    328.   	ctx->flags=0;
    329.   	}

crypto/dh/dh_check.c:107:7: Call
105.   		*ret|=DH_UNABLE_TO_CHECK_GENERATOR;
106.   
107.   	if (!BN_is_prime(dh->p,BN_prime_checks,NULL,ctx,NULL))
             ^
108.   		*ret|=DH_CHECK_P_NOT_PRIME;
109.   	else

crypto/bn/bn_prime.c:210:1: Parameter `ctx_passed->tos`
  208.   	}
  209.   
  210. > int BN_is_prime(const BIGNUM *a, int checks, void (*callback)(int,int,void *),
  211.   	BN_CTX *ctx_passed, void *cb_arg)
  212.   	{

crypto/bn/bn_prime.c:213:9: Call
  211.   	BN_CTX *ctx_passed, void *cb_arg)
  212.   	{
  213.   	return BN_is_prime_fasttest(a, checks, callback, ctx_passed, cb_arg, 0);
                 ^
  214.   	}
  215.   

crypto/bn/bn_prime.c:216:1: Parameter `ctx_passed->tos`
    214.   	}
    215.   
    216. > int BN_is_prime_fasttest(const BIGNUM *a, int checks,
    217.   		void (*callback)(int,int,void *),
    218.   		BN_CTX *ctx_passed, void *cb_arg,

crypto/bn/bn_prime.c:257:17: Assignment
    255.   	else
    256.   		A = a;
    257.   	A1 = &(ctx->bn[ctx->tos++]);
                           ^
    258.   	A1_odd = &(ctx->bn[ctx->tos++]);
    259.   	check = &(ctx->bn[ctx->tos++]);;

crypto/bn/bn_prime.c:258:21: Assignment
    256.   		A = a;
    257.   	A1 = &(ctx->bn[ctx->tos++]);
    258.   	A1_odd = &(ctx->bn[ctx->tos++]);
                               ^
    259.   	check = &(ctx->bn[ctx->tos++]);;
    260.   

crypto/bn/bn_prime.c:259:20: Assignment
    257.   	A1 = &(ctx->bn[ctx->tos++]);
    258.   	A1_odd = &(ctx->bn[ctx->tos++]);
    259.   	check = &(ctx->bn[ctx->tos++]);;
                              ^
    260.   
    261.   	/* compute A1 := A - 1 */

crypto/bn/bn_prime.c:283:7: Call
    281.   	if (mont == NULL)
    282.   		goto err;
    283.   	if (!BN_MONT_CTX_set(mont, A, ctx))
                 ^
    284.   		goto err;
    285.   	

crypto/bn/bn_mont.c:271:1: Parameter `ctx->tos`
      269.   	}
      270.   
      271. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
      272.   	{
      273.   	BIGNUM Ri,*R;

crypto/bn/bn_mont.c:300:8: Call
      298.   		tmod.neg=mod->neg;
      299.   							/* Ri = R^-1 mod N*/
      300.   		if ((BN_mod_inverse(&Ri,R,&tmod,ctx)) == NULL)
                    ^
      301.   			goto err;
      302.   		BN_lshift(&Ri,&Ri,BN_BITS2);		/* R*Ri */

crypto/bn/bn_gcd.c:143:1: Parameter `ctx->tos`
        141.   
        142.   /* solves ax == 1 (mod n) */
        143. > BIGNUM *BN_mod_inverse(BIGNUM *in, BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
        144.   	{
        145.   	BIGNUM *A,*B,*X,*Y,*M,*D,*R;

crypto/bn/bn_gcd.c:158:2: Assignment
        156.   	M= &(ctx->bn[ctx->tos+4]);
        157.   	Y= &(ctx->bn[ctx->tos+5]);
        158.   	ctx->tos+=6;
                ^
        159.   	if (in == NULL)
        160.   		R=BN_new();

crypto/bn/bn_gcd.c:201:2: Assignment
        199.   err:
        200.   	if ((ret == NULL) && (in == NULL)) BN_free(R);
        201.   	ctx->tos-=6;
                ^
        202.   	return(ret);
        203.   	}

crypto/bn/bn_prime.c:297:7: Call
    295.   		/* now 1 <= check < A */
    296.   
    297.   		j = witness(check, A, A1, A1_odd, k, ctx, mont);
                 ^
    298.   		if (j == -1) goto err;
    299.   		if (j)

crypto/bn/bn_prime.c:322:1: Parameter `ctx->tos`
      320.   	}
      321.   
      322. > static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1,
      323.   	const BIGNUM *a1_odd, int k, BN_CTX *ctx, BN_MONT_CTX *mont)
      324.   	{

crypto/bn/bn_prime.c:325:7: Call
      323.   	const BIGNUM *a1_odd, int k, BN_CTX *ctx, BN_MONT_CTX *mont)
      324.   	{
      325.   	if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
                   ^
      326.   		return -1;
      327.   	if (BN_is_one(w))

crypto/bn/bn_exp.c:301:1: Parameter `ctx->tos`
        299.   
        300.   /* #ifdef MONT_MUL_MOD */
        301. > int BN_mod_exp_mont(BIGNUM *rr, BIGNUM *a, const BIGNUM *p,
        302.   		    const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
        303.   	{

crypto/bn/bn_exp.c:320:15: Assignment
        318.   		return(0);
        319.   		}
        320.   	d= &(ctx->bn[ctx->tos++]);
                             ^
        321.   	r= &(ctx->bn[ctx->tos++]);
        322.   	bits=BN_num_bits(p);

crypto/bn/bn_exp.c:321:15: Assignment
        319.   		}
        320.   	d= &(ctx->bn[ctx->tos++]);
        321.   	r= &(ctx->bn[ctx->tos++]);
                             ^
        322.   	bits=BN_num_bits(p);
        323.   	if (bits == 0)

crypto/bn/bn_exp.c:339:8: Call
        337.   		{
        338.   		if ((mont=BN_MONT_CTX_new()) == NULL) goto err;
        339.   		if (!BN_MONT_CTX_set(mont,m,ctx)) goto err;
                      ^
        340.   		}
        341.   

crypto/bn/bn_mont.c:271:1: Parameter `ctx->tos`
          269.   	}
          270.   
          271. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
          272.   	{
          273.   	BIGNUM Ri,*R;

crypto/bn/bn_mont.c:300:8: Call
          298.   		tmod.neg=mod->neg;
          299.   							/* Ri = R^-1 mod N*/
          300.   		if ((BN_mod_inverse(&Ri,R,&tmod,ctx)) == NULL)
                        ^
          301.   			goto err;
          302.   		BN_lshift(&Ri,&Ri,BN_BITS2);		/* R*Ri */

crypto/bn/bn_gcd.c:143:1: Parameter `ctx->tos`
            141.   
            142.   /* solves ax == 1 (mod n) */
            143. > BIGNUM *BN_mod_inverse(BIGNUM *in, BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
            144.   	{
            145.   	BIGNUM *A,*B,*X,*Y,*M,*D,*R;

crypto/bn/bn_gcd.c:158:2: Assignment
            156.   	M= &(ctx->bn[ctx->tos+4]);
            157.   	Y= &(ctx->bn[ctx->tos+5]);
            158.   	ctx->tos+=6;
                    ^
            159.   	if (in == NULL)
            160.   		R=BN_new();

crypto/bn/bn_gcd.c:173:8: Call
            171.   	while (!BN_is_zero(B))
            172.   		{
            173.   		if (!BN_div(D,M,A,B,ctx)) goto err;
                          ^
            174.   		T=A;
            175.   		A=B;

crypto/bn/bn_div.c:122:1: <Offset trace>
120.   #else
121.   
122. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
123.   	   BN_CTX *ctx)
124.   	{

crypto/bn/bn_div.c:122:1: Parameter `ctx->tos`
              120.   #else
              121.   
              122. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
              123.   	   BN_CTX *ctx)
              124.   	{

crypto/bn/bn_div.c:122:1: <Length trace>
120.   #else
121.   
122. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
123.   	   BN_CTX *ctx)
124.   	{

crypto/bn/bn_div.c:122:1: Parameter `ctx->bn[*]`
              120.   #else
              121.   
              122. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
              123.   	   BN_CTX *ctx)
              124.   	{

crypto/bn/bn_div.c:151:2: Array access: Offset: [13, +oo] Size: 13 by call to `BN_is_prime` 
              149.   	tmp->neg=0;
              150.   	snum= &(ctx->bn[ctx->tos+1]);
              151.   	sdiv= &(ctx->bn[ctx->tos+2]);
                      ^
              152.   	if (dv == NULL)
              153.   		res= &(ctx->bn[ctx->tos+3]);
