crypto/dsa/dsa_ossl.c:394: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `BN_mod_exp2_mont`.
Showing all 36 steps of the trace


crypto/dsa/dsa_ossl.c:365:10: Call
363.        * Calculate W = inv(S) mod Q save W in u2
364.        */
365.       if ((BN_mod_inverse(u2, s, dsa->q, ctx)) == NULL)
                ^
366.           goto err;
367.   

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:255:5: Call
    253.       bn_check_top(n);
    254.   
    255.       BN_CTX_start(ctx);
               ^
    256.       A = BN_CTX_get(ctx);
    257.       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:547:5: Call
    545.       if ((ret == NULL) && (in == NULL))
    546.           BN_free(R);
    547.       BN_CTX_end(ctx);
               ^
    548.       bn_check_top(ret);
    549.       return (ret);

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

crypto/dsa/dsa_ossl.c:394:5: Call
392.       }
393.   
394.       DSA_MOD_EXP(goto err, dsa, t1, dsa->g, u1, dsa->pub_key, u2, dsa->p, ctx,
           ^
395.                   mont);
396.       /* BN_copy(&u1,&t1); */

crypto/bn/bn_exp2.c:117:1: Parameter `ctx->stack.depth`
  115.   #define TABLE_SIZE      32
  116.   
  117. > int BN_mod_exp2_mont(BIGNUM *rr, const BIGNUM *a1, const BIGNUM *p1,
  118.                        const BIGNUM *a2, const BIGNUM *p2, const BIGNUM *m,
  119.                        BN_CTX *ctx, BN_MONT_CTX *in_mont)

crypto/bn/bn_exp2.c:149:5: Call
  147.       bits = (bits1 > bits2) ? bits1 : bits2;
  148.   
  149.       BN_CTX_start(ctx);
             ^
  150.       d = BN_CTX_get(ctx);
  151.       r = 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_exp2.c:162:14: Call
  160.           if ((mont = BN_MONT_CTX_new()) == NULL)
  161.               goto err;
  162.           if (!BN_MONT_CTX_set(mont, m, ctx))
                      ^
  163.               goto err;
  164.       }

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_mod_exp2_mont` 
                  317.   static unsigned int BN_STACK_pop(BN_STACK *st)
                  318.   {
                  319.       return st->indexes[--(st->depth)];
                                    ^
                  320.   }
                  321.   
