crypto/bn/bn_mod.c:218: error: INTEGER_OVERFLOW_L2
  ([0, 3+max(0, `ctx->stack.depth`)] - 1):unsigned32 by call to `BN_CTX_end`.
Showing all 9 steps of the trace


crypto/bn/bn_mod.c:193:1: Parameter `ctx->stack.depth`
191.   
192.   /* slow but works */
193. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
194.                  BN_CTX *ctx)
195.   {

crypto/bn/bn_mod.c:203:5: Call
201.       bn_check_top(m);
202.   
203.       BN_CTX_start(ctx);
           ^
204.       if ((t = BN_CTX_get(ctx)) == NULL)
205.           goto err;

crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
  179.   }
  180.   
  181. > void BN_CTX_start(BN_CTX *ctx)
  182.   {
  183.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_mod.c:218:5: Call
216.       ret = 1;
217.    err:
218.       BN_CTX_end(ctx);
           ^
219.       return ret;
220.   }

crypto/bn/bn_ctx.c:195:1: Parameter `ctx->stack.depth`
  193.   }
  194.   
  195. > void BN_CTX_end(BN_CTX *ctx)
  196.   {
  197.       CTXDBG_ENTRY("BN_CTX_end", ctx);

crypto/bn/bn_ctx.c:201:27: Call
  199.           ctx->err_stack--;
  200.       else {
  201.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                   ^
  202.           /* Does this stack frame have anything to release? */
  203.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:274:1: <LHS trace>
272.   }
273.   
274. > static unsigned int BN_STACK_pop(BN_STACK *st)
275.   {
276.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:274:1: Parameter `st->depth`
    272.   }
    273.   
    274. > static unsigned int BN_STACK_pop(BN_STACK *st)
    275.   {
    276.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:276:12: Binary operation: ([0, 3+max(0, ctx->stack.depth)] - 1):unsigned32 by call to `BN_CTX_end` 
    274.   static unsigned int BN_STACK_pop(BN_STACK *st)
    275.   {
    276.       return st->indexes[--(st->depth)];
                      ^
    277.   }
    278.   

static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,\n               BN_CTX *ctx)\n{\n    BIGNUM *t;\n    int ret = 0;\n    bn_check_top(a);\n    bn_check_top(b);\n    bn_check_top(m);\n    BN_CTX_start(ctx);\n    if ((t = BN_CTX_get(ctx)) == NULL)\n        goto err;\n    if (a == b) {\n        if (!BN_sqr(t, a, ctx))\n            goto err;\n    } else {\n        if (!BN_mul(t, a, b, ctx))\n            goto err;\n    }\n    if (!BN_nnmod(r, t, m, ctx))\n        goto err;\n    bn_check_top(r);\n    ret = 1;\n err:\n    BN_CTX_end(ctx);\n    return ret;\n}', 'void BN_CTX_start(BN_CTX *ctx)\n{\n    CTXDBG_ENTRY("BN_CTX_start", ctx);\n    if (ctx->err_stack || ctx->too_many)\n        ctx->err_stack++;\n    else if (!BN_STACK_push(&ctx->stack, ctx->used)) {\n        BNerr(BN_F_BN_CTX_START, BN_R_TOO_MANY_TEMPORARY_VARIABLES);\n        ctx->err_stack++;\n    }\n    CTXDBG_EXIT(ctx);\n}', 'void BN_CTX_end(BN_CTX *ctx)\n{\n    CTXDBG_ENTRY("BN_CTX_end", ctx);\n    if (ctx->err_stack)\n        ctx->err_stack--;\n    else {\n        unsigned int fp = BN_STACK_pop(&ctx->stack);\n        if (fp < ctx->used)\n            BN_POOL_release(&ctx->pool, ctx->used - fp);\n        ctx->used = fp;\n        ctx->too_many = 0;\n    }\n    CTXDBG_EXIT(ctx);\n}', 'static unsigned int BN_STACK_pop(BN_STACK *st)\n{\n    return st->indexes[--(st->depth)];\n}']