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


crypto/ec/ecp_smpl.c:1055:1: Parameter `ctx->stack.depth`
1053.   }
1054.   
1055. > int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a,
1056.                         const EC_POINT *b, BN_CTX *ctx)
1057.   {

crypto/ec/ecp_smpl.c:1093:5: Call
1091.       }
1092.   
1093.       BN_CTX_start(ctx);
            ^
1094.       tmp1 = BN_CTX_get(ctx);
1095.       tmp2 = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
  169.   }
  170.   
  171. > void BN_CTX_start(BN_CTX *ctx)
  172.   {
  173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/ec/ecp_smpl.c:1158:5: Call
1156.   
1157.    end:
1158.       BN_CTX_end(ctx);
            ^
1159.       BN_CTX_free(new_ctx);
1160.       return ret;

crypto/bn/bn_ctx.c:185:1: Parameter `ctx->stack.depth`
  183.   }
  184.   
  185. > void BN_CTX_end(BN_CTX *ctx)
  186.   {
  187.       CTXDBG("ENTER BN_CTX_end()", ctx);

crypto/bn/bn_ctx.c:191:27: Call
  189.           ctx->err_stack--;
  190.       else {
  191.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                   ^
  192.           /* Does this stack frame have anything to release? */
  193.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:266:1: <LHS trace>
264.   }
265.   
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267.   {
268.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:266:1: Parameter `st->depth`
    264.   }
    265.   
    266. > static unsigned int BN_STACK_pop(BN_STACK *st)
    267.   {
    268.       return st->indexes[--(st->depth)];

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

static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a,\n                      const EC_POINT *b, BN_CTX *ctx)\n{\n    int (*field_mul) (const EC_GROUP *, BIGNUM *, const BIGNUM *,\n                      const BIGNUM *, BN_CTX *);\n    int (*field_sqr) (const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);\n    BN_CTX *new_ctx = NULL;\n    BIGNUM *tmp1, *tmp2, *Za23, *Zb23;\n    const BIGNUM *tmp1_, *tmp2_;\n    int ret = -1;\n    if (EC_POINT_is_at_infinity(group, a)) {\n        return EC_POINT_is_at_infinity(group, b) ? 0 : 1;\n    }\n    if (EC_POINT_is_at_infinity(group, b))\n        return 1;\n    if (a->Z_is_one && b->Z_is_one) {\n        return ((BN_cmp(a->X, b->X) == 0) && BN_cmp(a->Y, b->Y) == 0) ? 0 : 1;\n    }\n    field_mul = group->meth->field_mul;\n    field_sqr = group->meth->field_sqr;\n    if (ctx == NULL) {\n        ctx = new_ctx = BN_CTX_new();\n        if (ctx == NULL)\n            return -1;\n    }\n    BN_CTX_start(ctx);\n    tmp1 = BN_CTX_get(ctx);\n    tmp2 = BN_CTX_get(ctx);\n    Za23 = BN_CTX_get(ctx);\n    Zb23 = BN_CTX_get(ctx);\n    if (Zb23 == NULL)\n        goto end;\n    if (!b->Z_is_one) {\n        if (!field_sqr(group, Zb23, b->Z, ctx))\n            goto end;\n        if (!field_mul(group, tmp1, a->X, Zb23, ctx))\n            goto end;\n        tmp1_ = tmp1;\n    } else\n        tmp1_ = a->X;\n    if (!a->Z_is_one) {\n        if (!field_sqr(group, Za23, a->Z, ctx))\n            goto end;\n        if (!field_mul(group, tmp2, b->X, Za23, ctx))\n            goto end;\n        tmp2_ = tmp2;\n    } else\n        tmp2_ = b->X;\n    if (BN_cmp(tmp1_, tmp2_) != 0) {\n        ret = 1;\n        goto end;\n    }\n    if (!b->Z_is_one) {\n        if (!field_mul(group, Zb23, Zb23, b->Z, ctx))\n            goto end;\n        if (!field_mul(group, tmp1, a->Y, Zb23, ctx))\n            goto end;\n    } else\n        tmp1_ = a->Y;\n    if (!a->Z_is_one) {\n        if (!field_mul(group, Za23, Za23, a->Z, ctx))\n            goto end;\n        if (!field_mul(group, tmp2, b->Y, Za23, ctx))\n            goto end;\n    } else\n        tmp2_ = b->Y;\n    if (BN_cmp(tmp1_, tmp2_) != 0) {\n        ret = 1;\n        goto end;\n    }\n    ret = 0;\n end:\n    BN_CTX_end(ctx);\n    BN_CTX_free(new_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    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}']