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


test/bntest.c:320:11: Call
318.           goto err;
319.   
320.       if (!(TEST_true(BN_bntest_rand(a, 1024, 0, 0))))
                 ^
321.           goto err;
322.       for (i = 0; i < NUM0; i++) {

crypto/bn/bn_rand.c:111:1: Parameter `*rnd->d`
  109.   }
  110.   
  111. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
  112.   {
  113.       return bnrand(TESTING, rnd, bits, top, bottom, NULL);

crypto/bn/bn_rand.c:113:12: Call
  111.   int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
  112.   {
  113.       return bnrand(TESTING, rnd, bits, top, bottom, NULL);
                    ^
  114.   }
  115.   

crypto/bn/bn_rand.c:23:1: Parameter `*rnd->d`
    21.   } BNRAND_FLAG;
    22.   
    23. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom,
    24.                     BN_CTX *ctx)
    25.   {

test/bntest.c:328:20: Call
326.           BN_set_negative(b, rand_neg());
327.           if (!(TEST_true(BN_mod(c, a, b, ctx))
328.                   && TEST_true(BN_div(d, e, a, b, ctx))
                          ^
329.                   && TEST_true(BN_sub(e, e, c))
330.                   && TEST_BN_eq_zero(e)))

crypto/bn/bn_div.c:229:11: Call
  227.       }
  228.   
  229.       ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
                   ^
  230.   
  231.       if (ret) {

crypto/bn/bn_div.c:264:1: Parameter `dv->top`
    262.    *       divisor's length is considered public;
    263.    */
    264. > int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
    265.                        const BIGNUM *divisor, BN_CTX *ctx)
    266.   {

crypto/bn/bn_div.c:233:13: Call
  231.       if (ret) {
  232.           if (dv != NULL)
  233.               bn_correct_top(dv);
                     ^
  234.           if (rm != NULL)
  235.               bn_correct_top(rm);

crypto/bn/bn_lib.c:967:1: <Offset trace>
965.   }
966.   
967. > void bn_correct_top(BIGNUM *a)
968.   {
969.       BN_ULONG *ftl;

crypto/bn/bn_lib.c:967:1: Parameter `a->top`
    965.   }
    966.   
    967. > void bn_correct_top(BIGNUM *a)
    968.   {
    969.       BN_ULONG *ftl;

crypto/bn/bn_lib.c:970:5: Assignment
    968.   {
    969.       BN_ULONG *ftl;
    970.       int tmp_top = a->top;
               ^
    971.   
    972.       if (tmp_top > 0) {

crypto/bn/bn_lib.c:967:1: <Length trace>
965.   }
966.   
967. > void bn_correct_top(BIGNUM *a)
968.   {
969.       BN_ULONG *ftl;

crypto/bn/bn_lib.c:967:1: Parameter `*a->d`
    965.   }
    966.   
    967. > void bn_correct_top(BIGNUM *a)
    968.   {
    969.       BN_ULONG *ftl;

crypto/bn/bn_lib.c:973:14: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div` 
    971.   
    972.       if (tmp_top > 0) {
    973.           for (ftl = &(a->d[tmp_top]); tmp_top > 0; tmp_top--) {
                        ^
    974.               ftl--;
    975.               if (*ftl != 0)
