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


test/bntest.c:2282:14: Call
2280.   
2281.       for (trial = 0; trial <= 1; ++trial) {
2282.           if (!TEST_true(BN_set_word(r, primes[i]))
                     ^
2283.                   || !TEST_int_eq(BN_is_prime_fasttest_ex(r, 1, ctx, trial, NULL),
2284.                                   1))

crypto/bn/bn_lib.c:361:1: Parameter `*a->d`
  359.   }
  360.   
  361. > int BN_set_word(BIGNUM *a, BN_ULONG w)
  362.   {
  363.       bn_check_top(a);

crypto/bn/bn_lib.c:364:9: Call
  362.   {
  363.       bn_check_top(a);
  364.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                 ^
  365.           return 0;
  366.       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:2283:21: Call
2281.       for (trial = 0; trial <= 1; ++trial) {
2282.           if (!TEST_true(BN_set_word(r, primes[i]))
2283.                   || !TEST_int_eq(BN_is_prime_fasttest_ex(r, 1, ctx, trial, NULL),
                            ^
2284.                                   1))
2285.               goto err;

crypto/bn/bn_prime.c:186:1: Parameter `*w->d`
  184.   
  185.   /* See FIPS 186-4 C.3.1 Miller Rabin Probabilistic Primality Test. */
  186. > int BN_is_prime_fasttest_ex(const BIGNUM *w, int checks, BN_CTX *ctx_passed,
  187.                               int do_trial_division, BN_GENCB *cb)
  188.   {

crypto/bn/bn_prime.c:223:11: Call
  221.           goto err;
  222.   
  223.       ret = bn_miller_rabin_is_prime(w, checks, ctx, cb, 0, &status);
                   ^
  224.       if (!ret)
  225.           goto err;

crypto/bn/bn_prime.c:248:1: Parameter `*w->d`
    246.    * returns 0 if there was an error, otherwise it returns 1.
    247.    */
    248. > int bn_miller_rabin_is_prime(const BIGNUM *w, int iterations, BN_CTX *ctx,
    249.                                BN_GENCB *cb, int enhanced, int *status)
    250.   {

crypto/bn/bn_prime.c:315:14: Call
    313.           }
    314.           /* (Step 4.5) z = b^m mod w */
    315.           if (!BN_mod_exp_mont(z, b, m, w, ctx, mont))
                        ^
    316.               goto err;
    317.           /* (Step 4.6) if (z = 1 or z = w-1) */

crypto/bn/bn_exp.c:388:14: <Offset trace>
386.           /* 2^(top*BN_BITS2) - m */
387.           r->d[0] = (0 - m->d[0]) & BN_MASK2;
388.           for (i = 1; i < j; i++)
                    ^
389.               r->d[i] = (~m->d[i]) & BN_MASK2;
390.           r->top = j;

crypto/bn/bn_exp.c:388:14: Assignment
      386.           /* 2^(top*BN_BITS2) - m */
      387.           r->d[0] = (0 - m->d[0]) & BN_MASK2;
      388.           for (i = 1; i < j; i++)
                          ^
      389.               r->d[i] = (~m->d[i]) & BN_MASK2;
      390.           r->top = j;

crypto/bn/bn_exp.c:296:1: <Length trace>
294.   }
295.   
296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
297.                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
298.   {

crypto/bn/bn_exp.c:296:1: Parameter `*m->d`
      294.   }
      295.   
      296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
      297.                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
      298.   {

crypto/bn/bn_exp.c:389:25: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_is_prime_fasttest_ex` 
      387.           r->d[0] = (0 - m->d[0]) & BN_MASK2;
      388.           for (i = 1; i < j; i++)
      389.               r->d[i] = (~m->d[i]) & BN_MASK2;
                                     ^
      390.           r->top = j;
      391.           r->flags |= BN_FLG_FIXED_TOP;
