test/bntest.c:341: error: BUFFER_OVERRUN_L3
  Offset: [1, +oo] (⇐ [0, +oo] + [1, +oo]) Size: [0, 8388607] by call to `BN_mod_mul_montgomery`.
Showing all 13 steps of the trace


test/bntest.c:340:5: Call
338.           "D81FDC7C54E02B60262B241D53C040E99E45826ECA37A804668E690E1AFC1CA4"
339.           "2C9A15D84D4954425F0B7642FC0BD9D7B24E2618D2DCC9B729D944BADACFDDAF");
340.       BN_MONT_CTX_set(mont, n, ctx);
           ^
341.       BN_mod_mul_montgomery(c, a, b, mont, ctx);
342.       BN_mod_mul_montgomery(d, b, a, mont, ctx);

crypto/bn/bn_mont.c:247:1: Parameter `mont->N.top`
  245.   }
  246.   
  247. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
  248.   {
  249.       int ret = 0;

test/bntest.c:341:5: Call
339.           "2C9A15D84D4954425F0B7642FC0BD9D7B24E2618D2DCC9B729D944BADACFDDAF");
340.       BN_MONT_CTX_set(mont, n, ctx);
341.       BN_mod_mul_montgomery(c, a, b, mont, ctx);
           ^
342.       BN_mod_mul_montgomery(d, b, a, mont, ctx);
343.       if (BN_cmp(c, d)) {

crypto/bn/bn_mont.c:26:1: Parameter `mont->N.top`
  24.   #endif
  25.   
  26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
  27.                             BN_MONT_CTX *mont, BN_CTX *ctx)
  28.   {

crypto/bn/bn_mont.c:61:10: Call
  59.       /* reduce from aRR to aR */
  60.   #ifdef MONT_WORD
  61.       if (!BN_from_montgomery_word(r, tmp, mont))
                 ^
  62.           goto err;
  63.   #else

crypto/bn/bn_mont.c:104:21: <Offset trace>
102.       n0 = mont->n0[0];
103.   
104.       for (carry = 0, i = 0; i < nl; i++, rp++) {
                           ^
105.           v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
106.           v = (v + carry + rp[nl]) & BN_MASK2;

crypto/bn/bn_mont.c:104:21: Assignment
    102.       n0 = mont->n0[0];
    103.   
    104.       for (carry = 0, i = 0; i < nl; i++, rp++) {
                               ^
    105.           v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
    106.           v = (v + carry + rp[nl]) & BN_MASK2;

crypto/bn/bn_mont.c:75:1: <Length trace>
73.   
74.   #ifdef MONT_WORD
75. > static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
76.   {
77.       BIGNUM *n;

crypto/bn/bn_mont.c:75:1: Parameter `*r->d`
    73.   
    74.   #ifdef MONT_WORD
    75. > static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
    76.   {
    77.       BIGNUM *n;

crypto/bn/bn_mont.c:89:9: Call
    87.   
    88.       max = (2 * nl);             /* carry is stored separately */
    89.       if (bn_wexpand(r, max) == NULL)
                  ^
    90.           return (0);
    91.   

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_mont.c:94:5: Assignment
    92.       r->neg ^= n->neg;
    93.       np = n->d;
    94.       rp = r->d;
              ^
    95.   
    96.       /* clear the top words of T */

crypto/bn/bn_mont.c:106:26: Array access: Offset: [1, +oo] (⇐ [0, +oo] + [1, +oo]) Size: [0, 8388607] by call to `BN_mod_mul_montgomery` 
    104.       for (carry = 0, i = 0; i < nl; i++, rp++) {
    105.           v = bn_mul_add_words(rp, np, nl, (rp[0] * n0) & BN_MASK2);
    106.           v = (v + carry + rp[nl]) & BN_MASK2;
                                    ^
    107.           carry |= (v != rp[nl]);
    108.           carry &= (v <= rp[nl]);
