crypto/bn/bntest.c:644: error: BUFFER_OVERRUN_L3
  Offset: [3, +oo] (⇐ [1, +oo] + 2) Size: [0, +oo] by call to `BN_mod_exp`.
Showing all 22 steps of the trace


crypto/bn/bntest.c:638:2: Call
636.   	e=BN_new();
637.   
638.   	BN_rand(c,30,0,1); /* must be odd for montgomery */
        ^
639.   	for (i=0; i<6; i++)
640.   		{

crypto/bn/bn_rand.c:65:1: Parameter `*rnd->d`
  63.   #include <openssl/rand.h>
  64.   
  65. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  66.   	{
  67.   	unsigned char *buf=NULL;

crypto/bn/bntest.c:641:3: Call
639.   	for (i=0; i<6; i++)
640.   		{
641.   		BN_rand(a,20+i*5,0,0); /**/
         ^
642.   		BN_rand(b,2+i,0,0); /**/
643.   

crypto/bn/bn_rand.c:65:1: Parameter `*rnd->d`
  63.   #include <openssl/rand.h>
  64.   
  65. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  66.   	{
  67.   	unsigned char *buf=NULL;

crypto/bn/bntest.c:642:3: Call
640.   		{
641.   		BN_rand(a,20+i*5,0,0); /**/
642.   		BN_rand(b,2+i,0,0); /**/
         ^
643.   
644.   		if (!BN_mod_exp(d,a,b,c,ctx))

crypto/bn/bn_rand.c:65:1: Parameter `*rnd->d`
  63.   #include <openssl/rand.h>
  64.   
  65. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
  66.   	{
  67.   	unsigned char *buf=NULL;

crypto/bn/bntest.c:644:8: Call
642.   		BN_rand(b,2+i,0,0); /**/
643.   
644.   		if (!BN_mod_exp(d,a,b,c,ctx))
              ^
645.   			return(00);
646.   

crypto/bn/bn_exp.c:157:1: Parameter `*a->d`
  155.   	}
  156.   
  157. > int BN_mod_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BIGNUM *m, BN_CTX *ctx)
  158.   	{
  159.   	int ret;

crypto/bn/bn_exp.c:173:9: Call
  171.   
  172.   	if (BN_is_odd(m))
  173.   		{ ret=BN_mod_exp_mont(r,a,p,m,ctx,NULL); }
                 ^
  174.   	else
  175.   #endif

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

crypto/bn/bn_exp.c:348:7: Call
    346.   	else
    347.   		aa=a;
    348.   	if (!BN_to_montgomery(&(val[0]),aa,mont,ctx)) goto err; /* 1 */
                 ^
    349.   	if (!BN_mod_mul_montgomery(d,&(val[0]),&(val[0]),mont,ctx)) goto err; /* 2 */
    350.   

crypto/bn/bn_mont.c:71:1: Parameter `*a->d`
      69.   #define MONT_WORD
      70.   
      71. > int BN_mod_mul_montgomery(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_MONT_CTX *mont,
      72.   	     BN_CTX *ctx)
      73.   	{

crypto/bn/bn_mont.c:93:8: Call
      91.   			tmp->top--;
      92.   #else
      93.   		if (!BN_sqr(tmp,a,ctx)) goto err;
                   ^
      94.   #endif
      95.   		}

crypto/bn/bn_sqr.c:65:1: Parameter `*a->d`
        63.   /* r must not be a */
        64.   /* I've just gone over this and it is now %20 faster on x86 - eay - 27 Jun 96 */
        65. > int BN_sqr(BIGNUM *r, BIGNUM *a, BN_CTX *ctx)
        66.   	{
        67.   	int max,al;

crypto/bn/bn_sqr.c:130:5: Call
        128.   				{
        129.   				if (bn_wexpand(tmp,max) == NULL) return(0);
        130.   				bn_sqr_normal(rr->d,a->d,al,tmp->d);
                   ^
        131.   				}
        132.   			}

crypto/bn/bn_sqr.c:146:1: Parameter `*a`
          144.   
          145.   /* tmp must have 2*n words */
          146. > void bn_sqr_normal(BN_ULONG *r, BN_ULONG *a, int n, BN_ULONG *tmp)
          147.   	{
          148.   	int i,j,max;

crypto/bn/bn_sqr.c:152:2: Assignment
          150.   
          151.   	max=n*2;
          152.   	ap=a;
                  ^
          153.   	rp=r;
          154.   	rp[0]=rp[max-1]=0;

crypto/bn/bn_sqr.c:168:3: Assignment
          166.   		{
          167.   		j--;
          168.   		ap++;
                   ^
          169.   		rp[j]=bn_mul_add_words(rp,ap,j,ap[-1]);
          170.   		rp+=2;

crypto/bn/bn_sqr.c:169:9: Call
          167.   		j--;
          168.   		ap++;
          169.   		rp[j]=bn_mul_add_words(rp,ap,j,ap[-1]);
                         ^
          170.   		rp+=2;
          171.   		}

crypto/bn/bn_asm.c:143:1: <Length trace>
141.   #else
142.   
143. > BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
144.   	{
145.   	BN_ULONG c=0;

crypto/bn/bn_asm.c:143:1: Parameter `*ap`
            141.   #else
            142.   
            143. > BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
            144.   	{
            145.   	BN_ULONG c=0;

crypto/bn/bn_asm.c:160:3: Array access: Offset: [3, +oo] (⇐ [1, +oo] + 2) Size: [0, +oo] by call to `BN_mod_exp` 
            158.   		mul_add(rp[1],ap[1],bl,bh,c);
            159.   		if (--num == 0) break;
            160.   		mul_add(rp[2],ap[2],bl,bh,c);
                     ^
            161.   		if (--num == 0) break;
            162.   		mul_add(rp[3],ap[3],bl,bh,c);
