test/bntest.c:325: 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:319:5: Call
317.           goto err;
318.   
319.       BN_bntest_rand(a, 1024, 0, 0);
           ^
320.       for (i = 0; i < NUM0; i++) {
321.           BN_bntest_rand(b, 450 + i * 10, 0, 0);

crypto/bn/bn_rand.c:102:1: Parameter `*rnd->d`
  100.   }
  101.   
  102. > int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
  103.   {
  104.       return bnrand(TESTING, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:104:12: Call
  102.   int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom)
  103.   {
  104.       return bnrand(TESTING, rnd, bits, top, bottom);
                    ^
  105.   }
  106.   

crypto/bn/bn_rand.c:21:1: Parameter `*rnd->d`
    19.   } BNRAND_FLAG;
    20.   
    21. > static int bnrand(BNRAND_FLAG flag, BIGNUM *rnd, int bits, int top, int bottom)
    22.   {
    23.       unsigned char *buf = NULL;

test/bntest.c:325:9: Call
323.           BN_set_negative(b, rand_neg());
324.           BN_mod(c, a, b, ctx);
325.           BN_div(d, e, a, b, ctx);
               ^
326.           BN_sub(e, e, c);
327.           if (!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:944:1: <Offset trace>
942.   }
943.   
944. > void bn_correct_top(BIGNUM *a)
945.   {
946.       BN_ULONG *ftl;

crypto/bn/bn_lib.c:944:1: Parameter `a->top`
    942.   }
    943.   
    944. > void bn_correct_top(BIGNUM *a)
    945.   {
    946.       BN_ULONG *ftl;

crypto/bn/bn_lib.c:947:5: Assignment
    945.   {
    946.       BN_ULONG *ftl;
    947.       int tmp_top = a->top;
               ^
    948.   
    949.       if (tmp_top > 0) {

crypto/bn/bn_lib.c:944:1: <Length trace>
942.   }
943.   
944. > void bn_correct_top(BIGNUM *a)
945.   {
946.       BN_ULONG *ftl;

crypto/bn/bn_lib.c:944:1: Parameter `*a->d`
    942.   }
    943.   
    944. > void bn_correct_top(BIGNUM *a)
    945.   {
    946.       BN_ULONG *ftl;

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