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


crypto/ec/ec_check.c:59:1: Parameter `ctx->stack.depth`
57.   #include <openssl/err.h>
58.   
59. > int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx)
60.   {
61.       int ret = 0;

crypto/ec/ec_check.c:114:9: Call
112.    err:
113.       if (ctx != NULL)
114.           BN_CTX_end(ctx);
               ^
115.       BN_CTX_free(new_ctx);
116.       EC_POINT_free(point);

crypto/bn/bn_ctx.c:250:1: Parameter `ctx->stack.depth`
  248.   }
  249.   
  250. > void BN_CTX_end(BN_CTX *ctx)
  251.   {
  252.       CTXDBG_ENTRY("BN_CTX_end", ctx);

crypto/bn/bn_ctx.c:256:27: Call
  254.           ctx->err_stack--;
  255.       else {
  256.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                   ^
  257.           /* Does this stack frame have anything to release? */
  258.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:326:1: <LHS trace>
324.   }
325.   
326. > static unsigned int BN_STACK_pop(BN_STACK *st)
327.   {
328.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:326:1: Parameter `st->depth`
    324.   }
    325.   
    326. > static unsigned int BN_STACK_pop(BN_STACK *st)
    327.   {
    328.       return st->indexes[--(st->depth)];

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

static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['int EC_GROUP_check(const EC_GROUP *group, BN_CTX *ctx)\n{\n    int ret = 0;\n    BIGNUM *order;\n    BN_CTX *new_ctx = NULL;\n    EC_POINT *point = NULL;\n    if (ctx == NULL) {\n        ctx = new_ctx = BN_CTX_new();\n        if (ctx == NULL) {\n            ECerr(EC_F_EC_GROUP_CHECK, ERR_R_MALLOC_FAILURE);\n            goto err;\n        }\n    }\n    BN_CTX_start(ctx);\n    if ((order = BN_CTX_get(ctx)) == NULL)\n        goto err;\n    if (!EC_GROUP_check_discriminant(group, ctx)) {\n        ECerr(EC_F_EC_GROUP_CHECK, EC_R_DISCRIMINANT_IS_ZERO);\n        goto err;\n    }\n    if (group->generator == NULL) {\n        ECerr(EC_F_EC_GROUP_CHECK, EC_R_UNDEFINED_GENERATOR);\n        goto err;\n    }\n    if (EC_POINT_is_on_curve(group, group->generator, ctx) <= 0) {\n        ECerr(EC_F_EC_GROUP_CHECK, EC_R_POINT_IS_NOT_ON_CURVE);\n        goto err;\n    }\n    if ((point = EC_POINT_new(group)) == NULL)\n        goto err;\n    if (!EC_GROUP_get_order(group, order, ctx))\n        goto err;\n    if (BN_is_zero(order)) {\n        ECerr(EC_F_EC_GROUP_CHECK, EC_R_UNDEFINED_ORDER);\n        goto err;\n    }\n    if (!EC_POINT_mul(group, point, order, NULL, NULL, ctx))\n        goto err;\n    if (!EC_POINT_is_at_infinity(group, point)) {\n        ECerr(EC_F_EC_GROUP_CHECK, EC_R_INVALID_GROUP_ORDER);\n        goto err;\n    }\n    ret = 1;\n err:\n    if (ctx != NULL)\n        BN_CTX_end(ctx);\n    BN_CTX_free(new_ctx);\n    EC_POINT_free(point);\n    return ret;\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}']