crypto/bn/bn_mont.c:388: error: BUFFER_OVERRUN_S2
  Offset: [7+min(0, `mont->RR.top`), +oo] (⇐ [min(0, `mont->RR.top`), +oo] + 7) Size: [1+min(0, `mont->RR.top`), +oo] by call to `BN_mod`.
Showing all 22 steps of the trace


crypto/bn/bn_mont.c:301:1: Parameter `mont->RR.top`
299.   	}
300.   
301. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
302.   	{
303.   	BIGNUM Ri,*R;

crypto/bn/bn_mont.c:319:3: Call
317.   
318.   		mont->ri=(BN_num_bits(mod)+(BN_BITS2-1))/BN_BITS2*BN_BITS2;
319.   		BN_zero(R);
         ^
320.   		BN_set_bit(R,BN_BITS2);
321.   		/* I was bad, this modification of a passed variable was

crypto/bn/bn_lib.c:567:1: Parameter `a->top`
  565.   	}
  566.   
  567. > int BN_set_word(BIGNUM *a, BN_ULONG w)
  568.   	{
  569.   	int i,n;

crypto/bn/bn_mont.c:320:3: Call
318.   		mont->ri=(BN_num_bits(mod)+(BN_BITS2-1))/BN_BITS2*BN_BITS2;
319.   		BN_zero(R);
320.   		BN_set_bit(R,BN_BITS2);
         ^
321.   		/* I was bad, this modification of a passed variable was
322.   		 * breaking the multithreaded stuff :-(

crypto/bn/bn_lib.c:709:1: Parameter `a->top`
  707.   	}
  708.   
  709. > int BN_set_bit(BIGNUM *a, int n)
  710.   	{
  711.   	int i,j,k;

crypto/bn/bn_mont.c:333:8: Call
331.   		tmod.neg=mod->neg;
332.   
333.   		if ((BN_mod_inverse(&Ri,R,&tmod,ctx)) == NULL)
              ^
334.   			goto err;
335.   		BN_lshift(&Ri,&Ri,BN_BITS2);			/* R*Ri */

crypto/bn/bn_gcd.c:143:1: Parameter `a->top`
  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_mont.c:383:2: Call
381.   	/* setup RR for conversions */
382.   #if 1
383.   	BN_zero(&(mont->RR));
        ^
384.   	BN_set_bit(&(mont->RR),mont->ri*2);
385.   #else

crypto/bn/bn_lib.c:567:1: Parameter `a->top`
  565.   	}
  566.   
  567. > int BN_set_word(BIGNUM *a, BN_ULONG w)
  568.   	{
  569.   	int i,n;

crypto/bn/bn_mont.c:384:2: Call
382.   #if 1
383.   	BN_zero(&(mont->RR));
384.   	BN_set_bit(&(mont->RR),mont->ri*2);
        ^
385.   #else
386.   	BN_lshift(mont->RR,BN_value_one(),mont->ri*2);

crypto/bn/bn_lib.c:709:1: Parameter `a->top`
  707.   	}
  708.   
  709. > int BN_set_bit(BIGNUM *a, int n)
  710.   	{
  711.   	int i,j,k;

crypto/bn/bn_mont.c:388:2: Call
386.   	BN_lshift(mont->RR,BN_value_one(),mont->ri*2);
387.   #endif
388.   	BN_mod(&(mont->RR),&(mont->RR),&(mont->N),ctx);
        ^
389.   
390.   	return(1);

crypto/bn/bn_div.c:287:1: Parameter `rem->top`
  285.   
  286.   /* rem != m */
  287. > int BN_mod(BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
  288.   	{
  289.   #if 0 /* The old slow way */

crypto/bn/bn_div.c:313:9: Call
  311.   	return(1);
  312.   #else
  313.   	return(BN_div(NULL,rem,m,d,ctx));
                 ^
  314.   #endif
  315.   	}

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

crypto/bn/bn_div.c:142:10: Call
    140.   		{
    141.   		if (rm != NULL)
    142.   			{ if (BN_copy(rm,num) == NULL) return(0); }
                    ^
    143.   		if (dv != NULL) BN_zero(dv);
    144.   		return(1);

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

crypto/bn/bn_lib.c:508:6: Call
      506.   
      507.   	if (a == b) return(a);
      508.   	if (bn_wexpand(a,b->top) == NULL) return(NULL);
                  ^
      509.   
      510.   #if 1

crypto/bn/bn_lib.c:344:1: <Length trace>
342.   	}
343.   
344. > BIGNUM *bn_expand2(BIGNUM *b, int words)
345.   	{
346.   	BN_ULONG *A,*a;

crypto/bn/bn_lib.c:344:1: Parameter `b->top`
        342.   	}
        343.   
        344. > BIGNUM *bn_expand2(BIGNUM *b, int words)
        345.   	{
        346.   	BN_ULONG *A,*a;

crypto/bn/bn_lib.c:466:3: Assignment
        464.   		/* Now need to zero any data between b->top and b->max */
        465.   
        466.   		A= &(b->d[b->top]);
                 ^
        467.   		for (i=(b->max - b->top)>>3; i>0; i--,A+=8)
        468.   			{

crypto/bn/bn_lib.c:470:28: Array access: Offset: [7+min(0, mont->RR.top), +oo] (⇐ [min(0, mont->RR.top), +oo] + 7) Size: [1+min(0, mont->RR.top), +oo] by call to `BN_mod` 
        468.   			{
        469.   			A[0]=0; A[1]=0; A[2]=0; A[3]=0;
        470.   			A[4]=0; A[5]=0; A[6]=0; A[7]=0;
                                          ^
        471.   			}
        472.   		for (i=(b->max - b->top)&7; i>0; i--,A++)
