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


crypto/ec/ec_lib.c:309:5: Call
307.           return 0;
308.   
309.       BN_CTX_start(ctx);
           ^
310.       if ((q = BN_CTX_get(ctx)) == NULL)
311.           goto err;

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

crypto/ec/ec_lib.c:333:5: Call
331.       ret = 1;
332.    err:
333.       BN_CTX_end(ctx);
           ^
334.       BN_CTX_free(ctx);
335.       return ret;

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_guess_cofactor(EC_GROUP *group) {\n    int ret = 0;\n    BN_CTX *ctx = NULL;\n    BIGNUM *q = NULL;\n    if (BN_num_bits(group->order) <= (BN_num_bits(group->field) + 1) / 2 + 3) {\n        BN_zero(group->cofactor);\n        return 1;\n    }\n    if ((ctx = BN_CTX_new_ex(group->libctx)) == NULL)\n        return 0;\n    BN_CTX_start(ctx);\n    if ((q = BN_CTX_get(ctx)) == NULL)\n        goto err;\n    if (group->meth->field_type == NID_X9_62_characteristic_two_field) {\n        BN_zero(q);\n        if (!BN_set_bit(q, BN_num_bits(group->field) - 1))\n            goto err;\n    } else {\n        if (!BN_copy(q, group->field))\n            goto err;\n    }\n    if (!BN_rshift1(group->cofactor, group->order)\n        || !BN_add(group->cofactor, group->cofactor, q)\n        || !BN_add(group->cofactor, group->cofactor, BN_value_one())\n        || !BN_div(group->cofactor, NULL, group->cofactor, group->order, ctx))\n        goto err;\n    ret = 1;\n err:\n    BN_CTX_end(ctx);\n    BN_CTX_free(ctx);\n    return ret;\n}', 'void BN_CTX_start(BN_CTX *ctx)\n{\n    CTXDBG("ENTER 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("LEAVE BN_CTX_start()", ctx);\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}']