test/bntest.c:981: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_exp_recp`.
Showing all 12 steps of the trace


test/bntest.c:961:10: Call
959.        */
960.   
961.       if (!TEST_true(BN_generate_prime_ex(b, 512, 0, NULL, NULL, NULL)))
                ^
962.           goto err;
963.       BN_set_negative(b, rand_neg());

crypto/bn/bn_prime.c:52:1: Parameter `ret->top`
  50.   }
  51.   
  52. > int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe,
  53.                            const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb)
  54.   {

test/bntest.c:981:14: Call
979.           BN_set_negative(b, 0);
980.   
981.           if (!TEST_true(BN_mod_exp_recp(r, a, t, b, ctx)))
                    ^
982.               goto err;
983.           BN_set_negative(b, 1);

crypto/bn/bn_exp.c:161:1: Parameter `m->top`
  159.   }
  160.   
  161. > int BN_mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
  162.                       const BIGNUM *m, BN_CTX *ctx)
  163.   {

crypto/bn/bn_exp.c:200:14: Call
  198.       if (m->neg) {
  199.           /* ignore sign of 'm' */
  200.           if (!BN_copy(aa, m))
                      ^
  201.               goto err;
  202.           aa->neg = 0;

crypto/bn/bn_lib.c:280:1: <Offset trace>
278.   }
279.   
280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
281.   {
282.       bn_check_top(b);

crypto/bn/bn_lib.c:280:1: Parameter `b->top`
    278.   }
    279.   
    280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
    281.   {
    282.       bn_check_top(b);

crypto/bn/bn_lib.c:280:1: <Length trace>
278.   }
279.   
280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
281.   {
282.       bn_check_top(b);

crypto/bn/bn_lib.c:280:1: Parameter `*a->d`
    278.   }
    279.   
    280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
    281.   {
    282.       bn_check_top(b);

crypto/bn/bn_lib.c:286:9: Call
    284.       if (a == b)
    285.           return a;
    286.       if (bn_wexpand(a, b->top) == NULL)
                   ^
    287.           return NULL;
    288.   

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

crypto/bn/bn_lib.c:290:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_exp_recp` 
    288.   
    289.       if (b->top > 0)
    290.           memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
                   ^
    291.   
    292.       a->neg = b->neg;
