crypto/dh/dh_key.c:224: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `BN_MONT_CTX_set_locked`.
Showing all 29 steps of the trace


crypto/dh/dh_key.c:215:5: Call
213.       if (ctx == NULL)
214.           goto err;
215.       BN_CTX_start(ctx);
           ^
216.       tmp = BN_CTX_get(ctx);
217.   

crypto/bn/bn_ctx.c:227:1: Parameter `ctx->stack.depth`
  225.   }
  226.   
  227. > void BN_CTX_start(BN_CTX *ctx)
  228.   {
  229.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/dh/dh_key.c:224:16: Call
222.   
223.       if (dh->flags & DH_FLAG_CACHE_MONT_P) {
224.           mont = BN_MONT_CTX_set_locked(&dh->method_mont_p,
                      ^
225.                                         dh->lock, dh->p, ctx);
226.           if ((dh->flags & DH_FLAG_NO_EXP_CONSTTIME) == 0) {

crypto/bn/bn_mont.c:499:1: Parameter `ctx->stack.depth`
  497.   }
  498.   
  499. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock,
  500.                                       const BIGNUM *mod, BN_CTX *ctx)
  501.   {

crypto/bn/bn_mont.c:521:10: Call
  519.       if (ret == NULL)
  520.           return NULL;
  521.       if (!BN_MONT_CTX_set(ret, mod, ctx)) {
                  ^
  522.           BN_MONT_CTX_free(ret);
  523.           return NULL;

crypto/bn/bn_mont.c:348:1: Parameter `ctx->stack.depth`
    346.   }
    347.   
    348. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
    349.   {
    350.       int ret = 0;

crypto/bn/bn_mont.c:356:5: Call
    354.           return 0;
    355.   
    356.       BN_CTX_start(ctx);
               ^
    357.       if ((Ri = BN_CTX_get(ctx)) == NULL)
    358.           goto err;

crypto/bn/bn_ctx.c:227:1: Parameter `ctx->stack.depth`
      225.   }
      226.   
      227. > void BN_CTX_start(BN_CTX *ctx)
      228.   {
      229.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_mont.c:427:14: Call
    425.           tmod.top = buf[0] != 0 ? 1 : 0;
    426.           /* Ri = R^-1 mod N */
    427.           if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
                        ^
    428.               goto err;
    429.           if (!BN_lshift(Ri, Ri, BN_BITS2))

crypto/bn/bn_gcd.c:225:1: Parameter `ctx->stack.depth`
      223.                                           BN_CTX *ctx);
      224.   
      225. > BIGNUM *BN_mod_inverse(BIGNUM *in,
      226.                          const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
      227.   {

crypto/bn/bn_gcd.c:230:10: Call
      228.       BIGNUM *rv;
      229.       int noinv;
      230.       rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
                      ^
      231.       if (noinv)
      232.           BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE);

crypto/bn/bn_gcd.c:236:1: Parameter `ctx->stack.depth`
        234.   }
        235.   
        236. > BIGNUM *int_bn_mod_inverse(BIGNUM *in,
        237.                              const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,
        238.                              int *pnoinv)

crypto/bn/bn_gcd.c:249:16: Call
        247.       if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
        248.           || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
        249.           return BN_mod_inverse_no_branch(in, a, n, ctx);
                              ^
        250.       }
        251.   

crypto/bn/bn_gcd.c:556:1: Parameter `ctx->stack.depth`
          554.    * not contain branches that may leak sensitive information.
          555.    */
          556. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
          557.                                           const BIGNUM *a, const BIGNUM *n,
          558.                                           BN_CTX *ctx)

crypto/bn/bn_gcd.c:567:5: Call
          565.       bn_check_top(n);
          566.   
          567.       BN_CTX_start(ctx);
                     ^
          568.       A = BN_CTX_get(ctx);
          569.       B = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:227:1: Parameter `ctx->stack.depth`
            225.   }
            226.   
            227. > void BN_CTX_start(BN_CTX *ctx)
            228.   {
            229.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_gcd.c:602:18: Call
          600.               bn_init(&local_B);
          601.               BN_with_flags(&local_B, B, BN_FLG_CONSTTIME);
          602.               if (!BN_nnmod(B, &local_B, A, ctx))
                                  ^
          603.                   goto err;
          604.               /* Ensure local_B goes out of scope before any further use of B */

crypto/bn/bn_mod.c:118:1: Parameter `ctx->stack.depth`
            116.   #include "bn_lcl.h"
            117.   
            118. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
            119.   {
            120.       /*

crypto/bn/bn_mod.c:125:11: Call
            123.        */
            124.   
            125.       if (!(BN_mod(r, m, d, ctx)))
                             ^
            126.           return 0;
            127.       if (!r->neg)

crypto/bn/bn_div.c:241:5: Call
              239.       }
              240.   
              241.       BN_CTX_start(ctx);
                         ^
              242.       tmp = BN_CTX_get(ctx);
              243.       snum = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:227:1: Parameter `*ctx->stack.indexes`
                225.   }
                226.   
                227. > void BN_CTX_start(BN_CTX *ctx)
                228.   {
                229.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_div.c:460:5: Call
              458.       if (no_branch)
              459.           bn_correct_top(res);
              460.       BN_CTX_end(ctx);
                         ^
              461.       return (1);
              462.    err:

crypto/bn/bn_ctx.c:241:1: Parameter `*ctx->stack.indexes`
                239.   }
                240.   
                241. > void BN_CTX_end(BN_CTX *ctx)
                242.   {
                243.       CTXDBG_ENTRY("BN_CTX_end", ctx);

crypto/bn/bn_ctx.c:247:27: Call
                245.           ctx->err_stack--;
                246.       else {
                247.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                                 ^
                248.           /* Does this stack frame have anything to release? */
                249.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:317:1: <Offset trace>
315.   }
316.   
317. > static unsigned int BN_STACK_pop(BN_STACK *st)
318.   {
319.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:317:1: Parameter `st->depth`
                  315.   }
                  316.   
                  317. > static unsigned int BN_STACK_pop(BN_STACK *st)
                  318.   {
                  319.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:317:1: <Length trace>
315.   }
316.   
317. > static unsigned int BN_STACK_pop(BN_STACK *st)
318.   {
319.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:317:1: Parameter `*st->indexes`
                  315.   }
                  316.   
                  317. > static unsigned int BN_STACK_pop(BN_STACK *st)
                  318.   {
                  319.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:319:12: Array access: Offset: [-1, +oo] Size: [1, +oo] by call to `BN_MONT_CTX_set_locked` 
                  317.   static unsigned int BN_STACK_pop(BN_STACK *st)
                  318.   {
                  319.       return st->indexes[--(st->depth)];
                                    ^
                  320.   }
                  321.   
