crypto/bn/bn_mont.c:476: error: BUFFER_OVERRUN_L1
  Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: 2 by call to `BN_mod_inverse`.
Showing all 11 steps of the trace


crypto/bn/bn_mont.c:416:1: Array declaration
414.   	}
415.   
416. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
417.   	{
418.   	int ret = 0;

crypto/bn/bn_mont.c:432:3: Assignment
430.   		BN_ULONG buf[2];
431.   
432.   		tmod.d=buf;
         ^
433.   		tmod.dmax=2;
434.   		tmod.neg=0;

crypto/bn/bn_mont.c:476:8: Call
474.   		tmod.top = buf[0] != 0 ? 1 : 0;
475.   							/* Ri = R^-1 mod N*/
476.   		if ((BN_mod_inverse(Ri,R,&tmod,ctx)) == NULL)
              ^
477.   			goto err;
478.   		if (!BN_lshift(Ri,Ri,BN_BITS2)) goto err; /* R*Ri */

crypto/bn/bn_gcd.c:208:1: Parameter `*n->d`
  206.   static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
  207.           const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
  208. > BIGNUM *BN_mod_inverse(BIGNUM *in,
  209.   	const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
  210.   	{

crypto/bn/bn_gcd.c:217:10: Call
  215.   	if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0) || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0))
  216.   		{
  217.   		return BN_mod_inverse_no_branch(in, a, n, ctx);
                  ^
  218.   		}
  219.   

crypto/bn/bn_gcd.c:506:1: Parameter `*n->d`
    504.    * It does not contain branches that may leak sensitive information.
    505.    */
    506. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
    507.   	const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
    508.   	{

crypto/bn/bn_gcd.c:537:6: Call
    535.   	BN_zero(Y);
    536.   	if (BN_copy(B,a) == NULL) goto err;
    537.   	if (BN_copy(A,n) == NULL) goto err;
                ^
    538.   	A->neg = 0;
    539.   

crypto/bn/bn_lib.c:497:1: <Length trace>
495.   	}
496.   
497. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
498.   	{
499.   	int i;

crypto/bn/bn_lib.c:497:1: Parameter `*b->d`
      495.   	}
      496.   
      497. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
      498.   	{
      499.   	int i;

crypto/bn/bn_lib.c:510:2: Assignment
      508.   #if 1
      509.   	A=a->d;
      510.   	B=b->d;
              ^
      511.   	for (i=b->top>>2; i>0; i--,A+=4,B+=4)
      512.   		{

crypto/bn/bn_lib.c:514:33: Array access: Offset: [3, +oo] (⇐ [0, +oo] + 3) Size: 2 by call to `BN_mod_inverse` 
      512.   		{
      513.   		BN_ULONG a0,a1,a2,a3;
      514.   		a0=B[0]; a1=B[1]; a2=B[2]; a3=B[3];
                                             ^
      515.   		A[0]=a0; A[1]=a1; A[2]=a2; A[3]=a3;
      516.   		}
