test/bntest.c:1910: 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:1886:10: Call
1884.   
1885.       /* Test that BN_mul never gives negative zero. */
1886.       if (!BN_set_word(a, 1))
                 ^
1887.           goto err;
1888.       BN_set_negative(a, 1);

crypto/bn/bn_lib.c:393:1: Parameter `*a->d`
  391.   }
  392.   
  393. > int BN_set_word(BIGNUM *a, BN_ULONG w)
  394.   {
  395.       bn_check_top(a);

crypto/bn/bn_lib.c:396:9: Call
  394.   {
  395.       bn_check_top(a);
  396.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                 ^
  397.           return (0);
  398.       a->neg = 0;

crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
    658.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
    659.   
    660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
    661.   {
    662.       if (bits > (INT_MAX - BN_BITS2 + 1))

test/bntest.c:1910:14: Call
1908.               goto err;
1909.           BN_set_negative(numerator, 1);
1910.           if (!BN_div(a, b, numerator, denominator, ctx))
                     ^
1911.               goto err;
1912.           if (!BN_is_zero(a) || BN_is_negative(a)) {

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

crypto/bn/bn_div.c:257:10: Call
  255.   
  256.       /* Setup to 'res' */
  257.       if (!bn_wexpand(res, (loop + 1)))
                  ^
  258.           goto err;
  259.       res->neg = (num->neg ^ divisor->neg);

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

crypto/bn/bn_div.c:409:9: Call
  407.            */
  408.           int neg = num->neg;
  409.           BN_rshift(rm, snum, norm_shift);
                 ^
  410.           if (!BN_is_zero(rm))
  411.               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.           }
