test/bntest.c:1848: 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:1846:5: Call
1844.               || !TEST_ptr(mont = BN_MONT_CTX_new()))
1845.           goto err;
1846.       BN_zero(zero);
            ^
1847.   
1848.       if (!TEST_false(BN_div(a, b, BN_value_one(), zero, ctx)))

crypto/bn/bn_lib.c:387:1: Parameter `*a->d`
  385.   }
  386.   
  387. > int BN_set_word(BIGNUM *a, BN_ULONG w)
  388.   {
  389.       bn_check_top(a);

crypto/bn/bn_lib.c:390:9: Call
  388.   {
  389.       bn_check_top(a);
  390.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                 ^
  391.           return 0;
  392.       a->neg = 0;

crypto/bn/bn_lcl.h:651:1: Parameter `*a->d`
    649.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
    650.   
    651. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
    652.   {
    653.       if (bits > (INT_MAX - BN_BITS2 + 1))

test/bntest.c:1848:10: Call
1846.       BN_zero(zero);
1847.   
1848.       if (!TEST_false(BN_div(a, b, BN_value_one(), zero, ctx)))
                 ^
1849.           goto err;
1850.       ERR_clear_error();

crypto/bn/bn_div.c:137:1: Parameter `*dv->d`
  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:251:10: Call
  249.   
  250.       /* Setup to 'res' */
  251.       if (!bn_wexpand(res, (loop + 1)))
                  ^
  252.           goto err;
  253.       res->neg = (num->neg ^ divisor->neg);

crypto/bn/bn_lib.c:940:1: Parameter `*a->d`
    938.   }
    939.   
    940. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
    941.   {
    942.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_div.c:403:9: Call
  401.            */
  402.           int neg = num->neg;
  403.           BN_rshift(rm, snum, norm_shift);
                 ^
  404.           if (!BN_is_zero(rm))
  405.               rm->neg = neg;

crypto/bn/bn_shift.c:122:1: <Length trace>
120.   }
121.   
122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
123.   {
124.       int i, j, nw, lb, rb;

crypto/bn/bn_shift.c:122:1: Parameter `*a->d`
    120.   }
    121.   
    122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
    123.   {
    124.       int i, j, nw, lb, rb;

crypto/bn/bn_shift.c:153:5: Assignment
    151.       }
    152.   
    153.       f = &(a->d[nw]);
               ^
    154.       t = r->d;
    155.       j = a->top - nw;

crypto/bn/bn_shift.c:162:15: Assignment
    160.               *(t++) = *(f++);
    161.       } else {
    162.           l = *(f++);
                         ^
    163.           for (i = j - 1; i != 0; i--) {
    164.               tmp = (l >> rb) & BN_MASK2;

crypto/bn/bn_shift.c:165:17: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_div` 
    163.           for (i = j - 1; i != 0; i--) {
    164.               tmp = (l >> rb) & BN_MASK2;
    165.               l = *(f++);
                           ^
    166.               *(t++) = (tmp | (l << lb)) & BN_MASK2;
    167.           }
