crypto/dh/dh_check.c:165: error: BUFFER_OVERRUN_L3
  Offset: [1, +oo] Size: [0, 8388607] by call to `BN_mod_exp`.
Showing all 18 steps of the trace


crypto/dh/dh_check.c:153:11: Call
151.           goto err;
152.       BN_CTX_start(ctx);
153.       tmp = BN_CTX_get(ctx);
                 ^
154.       if (tmp == NULL || !BN_set_word(tmp, 1))
155.           goto err;

crypto/bn/bn_ctx.c:283:5: Call
  281.       }
  282.       /* OK, make sure the returned bignum is "zero" */
  283.       BN_zero(ret);
             ^
  284.       ctx->used++;
  285.       CTXDBG_RET(ctx, ret);

crypto/bn/bn_lib.c:520:1: Parameter `*a->d`
    518.   }
    519.   
    520. > int BN_set_word(BIGNUM *a, BN_ULONG w)
    521.   {
    522.       bn_check_top(a);

crypto/dh/dh_check.c:165:14: Call
163.       if (dh->q != NULL) {
164.           /* Check pub_key^q == 1 mod p */
165.           if (!BN_mod_exp(tmp, pub_key, dh->q, dh->p, ctx))
                    ^
166.               goto err;
167.           if (!BN_is_one(tmp))

crypto/bn/bn_exp.c:190:1: Parameter `*r->d`
  188.   }
  189.   
  190. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
  191.                  BN_CTX *ctx)
  192.   {

crypto/bn/bn_exp.c:247:19: Call
  245.               && (BN_get_flags(p, BN_FLG_CONSTTIME) == 0)) {
  246.               BN_ULONG A = a->d[0];
  247.               ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL);
                           ^
  248.           } else
  249.   # endif

crypto/bn/bn_exp.c:1151:1: Parameter `*rr->d`
    1149.   }
    1150.   
    1151. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
    1152.                            const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
    1153.   {

crypto/bn/bn_exp.c:1286:14: Call
    1284.               goto err;
    1285.       } else {
    1286.           if (!BN_from_montgomery(rr, r, mont, ctx))
                         ^
    1287.               goto err;
    1288.       }

crypto/bn/bn_mont.c:267:1: Parameter `*ret->d`
      265.   #endif                          /* MONT_WORD */
      266.   
      267. > int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, BN_MONT_CTX *mont,
      268.                          BN_CTX *ctx)
      269.   {

crypto/bn/bn_mont.c:276:16: Call
      274.       BN_CTX_start(ctx);
      275.       if ((t = BN_CTX_get(ctx)) && BN_copy(t, a))
      276.           retn = BN_from_montgomery_word(ret, t, mont);
                            ^
      277.       BN_CTX_end(ctx);
      278.   #else                           /* !MONT_WORD */

crypto/bn/bn_mont.c:236:14: <Offset trace>
234.               (BN_ULONG *)(((PTR_SIZE_INT) rp & ~m) | ((PTR_SIZE_INT) ap & m));
235.   
236.           for (i = 0, nl -= 4; i < nl; i += 4) {
                    ^
237.               BN_ULONG t1, t2, t3, t4;
238.   

crypto/bn/bn_mont.c:236:14: Assignment
        234.               (BN_ULONG *)(((PTR_SIZE_INT) rp & ~m) | ((PTR_SIZE_INT) ap & m));
        235.   
        236.           for (i = 0, nl -= 4; i < nl; i += 4) {
                            ^
        237.               BN_ULONG t1, t2, t3, t4;
        238.   

crypto/bn/bn_mont.c:176:1: <Length trace>
174.   
175.   #ifdef MONT_WORD
176. > static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
177.   {
178.       BIGNUM *n;

crypto/bn/bn_mont.c:176:1: Parameter `*ret->d`
        174.   
        175.   #ifdef MONT_WORD
        176. > static int BN_from_montgomery_word(BIGNUM *ret, BIGNUM *r, BN_MONT_CTX *mont)
        177.   {
        178.       BIGNUM *n;

crypto/bn/bn_mont.c:213:9: Call
        211.       }
        212.   
        213.       if (bn_wexpand(ret, nl) == NULL)
                       ^
        214.           return (0);
        215.       ret->top = nl;

crypto/bn/bn_lib.c:985:1: Parameter `*a->d`
          983.   }
          984.   
          985. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
          986.   {
          987.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_mont.c:218:5: Assignment
        216.       ret->neg = r->neg;
        217.   
        218.       rp = ret->d;
                   ^
        219.       ap = &(r->d[nl]);
        220.   

crypto/bn/bn_mont.c:247:13: Array access: Offset: [1, +oo] Size: [0, 8388607] by call to `BN_mod_exp` 
        245.               rp[i + 0] = t1;
        246.               ap[i + 2] = 0;
        247.               rp[i + 1] = t2;
                           ^
        248.               ap[i + 3] = 0;
        249.               rp[i + 2] = t3;
