test/bntest.c:1964: 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:1962:5: Call
1960.       if (a == NULL || b == NULL || zero == NULL || mont == NULL)
1961.           goto err;
1962.       BN_zero(zero);
            ^
1963.   
1964.       if (BN_div(a, b, BN_value_one(), zero, ctx)) {

crypto/bn/bn_lib.c:463:1: Parameter `*a->d`
  461.   }
  462.   
  463. > int BN_set_word(BIGNUM *a, BN_ULONG w)
  464.   {
  465.       bn_check_top(a);

crypto/bn/bn_lib.c:466:9: Call
  464.   {
  465.       bn_check_top(a);
  466.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                 ^
  467.           return (0);
  468.       a->neg = 0;

crypto/bn/bn_lcl.h:674:1: Parameter `*a->d`
    672.   int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx);
    673.   
    674. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
    675.   {
    676.       if (bits > (INT_MAX - BN_BITS2 + 1))

test/bntest.c:1964:9: Call
1962.       BN_zero(zero);
1963.   
1964.       if (BN_div(a, b, BN_value_one(), zero, ctx)) {
                ^
1965.           fprintf(stderr, "Division by zero succeeded!\n");
1966.           goto err;

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:1016:1: Parameter `*a->d`
    1014.   }
    1015.   
    1016. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
    1017.   {
    1018.       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:120:1: <Length trace>
118.   }
119.   
120. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
121.   {
122.       int i, j, nw, lb, rb;

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

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

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

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