crypto/ec/ec_lib.c:1123: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end`.
Showing all 7 steps of the trace


crypto/ec/ec_lib.c:1084:1: Parameter `ctx->stack.depth`
1082.   }
1083.   
1084. > static int ec_field_inverse_mod_ord(const EC_GROUP *group, BIGNUM *r,
1085.                                       const BIGNUM *x, BN_CTX *ctx)
1086.   {

crypto/ec/ec_lib.c:1123:5: Call
1121.   
1122.    err:
1123.       BN_CTX_end(ctx);
            ^
1124.   #ifndef FIPS_MODE
1125.       BN_CTX_free(new_ctx);

crypto/bn/bn_ctx.c:208:1: Parameter `ctx->stack.depth`
  206.   }
  207.   
  208. > void BN_CTX_end(BN_CTX *ctx)
  209.   {
  210.       if (ctx == NULL)

crypto/bn/bn_ctx.c:216:27: Call
  214.           ctx->err_stack--;
  215.       else {
  216.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                   ^
  217.           /* Does this stack frame have anything to release? */
  218.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:298:1: <LHS trace>
296.   }
297.   
298. > static unsigned int BN_STACK_pop(BN_STACK *st)
299.   {
300.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:298:1: Parameter `st->depth`
    296.   }
    297.   
    298. > static unsigned int BN_STACK_pop(BN_STACK *st)
    299.   {
    300.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:300:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end` 
    298.   static unsigned int BN_STACK_pop(BN_STACK *st)
    299.   {
    300.       return st->indexes[--(st->depth)];
                      ^
    301.   }
    302.   

static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['static int ec_field_inverse_mod_ord(const EC_GROUP *group, BIGNUM *r,\n                                    const BIGNUM *x, BN_CTX *ctx)\n{\n    BIGNUM *e = NULL;\n    int ret = 0;\n#ifndef FIPS_MODE\n    BN_CTX *new_ctx = NULL;\n    if (ctx == NULL)\n        ctx = new_ctx = BN_CTX_secure_new();\n#endif\n    if (ctx == NULL)\n        return 0;\n    if (group->mont_data == NULL)\n        goto err;\n    BN_CTX_start(ctx);\n    if ((e = BN_CTX_get(ctx)) == NULL)\n        goto err;\n    if (!BN_set_word(e, 2))\n        goto err;\n    if (!BN_sub(e, group->order, e))\n        goto err;\n    if (!BN_mod_exp_mont(r, x, e, group->order, ctx, group->mont_data))\n        goto err;\n    ret = 1;\n err:\n    BN_CTX_end(ctx);\n#ifndef FIPS_MODE\n    BN_CTX_free(new_ctx);\n#endif\n    return ret;\n}', 'void BN_CTX_end(BN_CTX *ctx)\n{\n    if (ctx == NULL)\n        return;\n    CTXDBG("ENTER 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("LEAVE BN_CTX_end()", ctx);\n}', 'static unsigned int BN_STACK_pop(BN_STACK *st)\n{\n    return st->indexes[--(st->depth)];\n}']