test/bntest.c:2096: 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:2095:10: Call
2093.        * do_trial_division was set. */
2094.       if (r == NULL ||
2095.           !BN_set_word(r, 3) ||
                 ^
2096.           BN_is_prime_fasttest_ex(r, 3 /* nchecks */, ctx,
2097.                                   0 /* do_trial_division */, NULL) != 1 ||

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

crypto/bn/bn_lib.c:398:9: Call
  396.   {
  397.       bn_check_top(a);
  398.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                 ^
  399.           return (0);
  400.       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:2096:9: Call
2094.       if (r == NULL ||
2095.           !BN_set_word(r, 3) ||
2096.           BN_is_prime_fasttest_ex(r, 3 /* nchecks */, ctx,
                ^
2097.                                   0 /* do_trial_division */, NULL) != 1 ||
2098.           BN_is_prime_fasttest_ex(r, 3 /* nchecks */, ctx,

crypto/bn/bn_prime.c:153:1: Parameter `*a->d`
  151.   }
  152.   
  153. > int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
  154.                               int do_trial_division, BN_GENCB *cb)
  155.   {

crypto/bn/bn_prime.c:227:13: Call
  225.           /* now 1 <= check < a */
  226.   
  227.           j = witness(check, a, A1, A1_odd, k, ctx, mont);
                     ^
  228.           if (j == -1)
  229.               goto err;

crypto/bn/bn_prime.c:249:1: Parameter `*a->d`
    247.   }
    248.   
    249. > static int witness(BIGNUM *w, const BIGNUM *a, const BIGNUM *a1,
    250.                      const BIGNUM *a1_odd, int k, BN_CTX *ctx,
    251.                      BN_MONT_CTX *mont)

crypto/bn/bn_prime.c:253:10: Call
    251.                      BN_MONT_CTX *mont)
    252.   {
    253.       if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
                    ^
    254.           return -1;
    255.       if (BN_is_one(w))

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

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

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

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

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