test/bntest.c:1252: error: BUFFER_OVERRUN_L3
  Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div`.
Showing all 17 steps of the trace


test/bntest.c:1240:10: Call
1238.       int st = 0;
1239.   
1240.       if (!TEST_ptr(a = getBN(s, "A"))
                 ^
1241.               || !TEST_ptr(square = getBN(s, "Square"))
1242.               || !TEST_ptr(zero = BN_new())

test/bntest.c:107:9: Call
  105.       }
  106.   
  107.       if (parseBN(&ret, hex) != (int)strlen(hex)) {
                 ^
  108.           TEST_error("Could not decode '%s'", hex);
  109.           return NULL;

test/bntest.c:88:12: Call
    86.   {
    87.       *out = NULL;
    88.       return BN_hex2bn(out, in);
                     ^
    89.   }
    90.   

crypto/bn/bn_print.c:166:5: Assignment
      164.       j = i;                      /* least significant 'hex' */
      165.       m = 0;
      166.       h = 0;
                 ^
      167.       while (j > 0) {
      168.           m = (BN_BYTES * 2 <= j) ? BN_BYTES * 2 : j;

crypto/bn/bn_print.c:184:5: Assignment
      182.           j -= BN_BYTES * 2;
      183.       }
      184.       ret->top = h;
                 ^
      185.       bn_correct_top(ret);
      186.   

test/bntest.c:1252:17: Call
1250.               || !TEST_true(BN_mul(ret, a, a, ctx))
1251.               || !equalBN("A * A", square, ret)
1252.               || !TEST_true(BN_div(ret, remainder, square, a, ctx))
                        ^
1253.               || !equalBN("Square / A", a, ret)
1254.               || !equalBN("Square % A", zero, remainder))

crypto/bn/bn_div.c:188:1: Parameter `num->top`
  186.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
  187.    */
  188. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
  189.              BN_CTX *ctx)
  190.   {

crypto/bn/bn_div.c:255:11: Call
  253.       sdiv->neg = 0;
  254.       norm_shift += BN_BITS2;
  255.       if (!(BN_lshift(snum, num, norm_shift)))
                   ^
  256.           goto err;
  257.       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:939:1: Parameter `*a->d`
      937.   }
      938.   
      939. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
      940.   {
      941.       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.           }
