crypto/bn/bn_mont.c:385: error: BUFFER_OVERRUN_L3
  Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div`.
Showing all 23 steps of the trace


crypto/bn/bn_mont.c:251:1: Parameter `mont->RR.top`
249.   }
250.   
251. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
252.   {
253.       int i, ret = 0;

crypto/bn/bn_mont.c:329:9: Call
327.           mont->n0[1] = (Ri->top > 1) ? Ri->d[1] : 0;
328.   # else
329.           BN_zero(R);
               ^
330.           if (!(BN_set_bit(R, BN_BITS2)))
331.               goto err;           /* R */

crypto/bn/bn_lib.c:366:15: Assignment
  364.       a->neg = 0;
  365.       a->d[0] = w;
  366.       a->top = (w ? 1 : 0);
                       ^
  367.       a->flags &= ~BN_FLG_FIXED_TOP;
  368.       bn_check_top(a);

crypto/bn/bn_lib.c:366:5: Assignment
  364.       a->neg = 0;
  365.       a->d[0] = w;
  366.       a->top = (w ? 1 : 0);
             ^
  367.       a->flags &= ~BN_FLG_FIXED_TOP;
  368.       bn_check_top(a);

crypto/bn/bn_mont.c:330:15: Call
328.   # else
329.           BN_zero(R);
330.           if (!(BN_set_bit(R, BN_BITS2)))
                     ^
331.               goto err;           /* R */
332.   

crypto/bn/bn_lib.c:594:1: Parameter `a->top`
  592.   }
  593.   
  594. > int BN_set_bit(BIGNUM *a, int n)
  595.   {
  596.       int i, j, k;

crypto/bn/bn_mont.c:382:5: Call
380.   
381.       /* setup RR for conversions */
382.       BN_zero(&(mont->RR));
           ^
383.       if (!BN_set_bit(&(mont->RR), mont->ri * 2))
384.           goto err;

crypto/bn/bn_lib.c:366:15: Assignment
  364.       a->neg = 0;
  365.       a->d[0] = w;
  366.       a->top = (w ? 1 : 0);
                       ^
  367.       a->flags &= ~BN_FLG_FIXED_TOP;
  368.       bn_check_top(a);

crypto/bn/bn_lib.c:366:5: Assignment
  364.       a->neg = 0;
  365.       a->d[0] = w;
  366.       a->top = (w ? 1 : 0);
             ^
  367.       a->flags &= ~BN_FLG_FIXED_TOP;
  368.       bn_check_top(a);

crypto/bn/bn_mont.c:383:10: Call
381.       /* setup RR for conversions */
382.       BN_zero(&(mont->RR));
383.       if (!BN_set_bit(&(mont->RR), mont->ri * 2))
                ^
384.           goto err;
385.       if (!BN_mod(&(mont->RR), &(mont->RR), &(mont->N), ctx))

crypto/bn/bn_lib.c:594:1: Parameter `a->top`
  592.   }
  593.   
  594. > int BN_set_bit(BIGNUM *a, int n)
  595.   {
  596.       int i, j, k;

crypto/bn/bn_mont.c:385:10: Call
383.       if (!BN_set_bit(&(mont->RR), mont->ri * 2))
384.           goto err;
385.       if (!BN_mod(&(mont->RR), &(mont->RR), &(mont->N), ctx))
                ^
386.           goto err;
387.   

crypto/bn/bn_div.c:137:1: Parameter `num->top`
  135.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
  136.    */
  137. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
  138.              BN_CTX *ctx)
  139.   {

crypto/bn/bn_div.c:204:11: Call
  202.       sdiv->neg = 0;
  203.       norm_shift += BN_BITS2;
  204.       if (!(BN_lshift(snum, num, norm_shift)))
                   ^
  205.           goto err;
  206.       snum->neg = 0;

crypto/bn/bn_shift.c:83:1: <Offset trace>
81.   }
82.   
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84.   {
85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:83:1: Parameter `n`
    81.   }
    82.   
    83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
    84.   {
    85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:97:5: Assignment
    95.       }
    96.   
    97.       nw = n / BN_BITS2;
               ^
    98.       if (bn_wexpand(r, a->top + nw + 1) == NULL)
    99.           return 0;

crypto/bn/bn_shift.c:83:1: <Length trace>
81.   }
82.   
83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
84.   {
85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:83:1: Parameter `*r->d`
    81.   }
    82.   
    83. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
    84.   {
    85.       int i, nw, lb, rb;

crypto/bn/bn_shift.c:98:9: Call
    96.   
    97.       nw = n / BN_BITS2;
    98.       if (bn_wexpand(r, a->top + nw + 1) == NULL)
                   ^
    99.           return 0;
    100.       r->neg = a->neg;

crypto/bn/bn_lib.c:948:1: Parameter `*a->d`
      946.   }
      947.   
      948. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
      949.   {
      950.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_shift.c:104:5: Assignment
    102.       rb = BN_BITS2 - lb;
    103.       f = a->d;
    104.       t = r->d;
               ^
    105.       t[a->top + nw] = 0;
    106.       if (lb == 0)

crypto/bn/bn_shift.c:112:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div` 
    110.           for (i = a->top - 1; i >= 0; i--) {
    111.               l = f[i];
    112.               t[nw + i + 1] |= (l >> rb) & BN_MASK2;
                       ^
    113.               t[nw + i] = (l << lb) & BN_MASK2;
    114.           }
