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


crypto/ec/ecp_smpl.c:1093:1: Parameter `ctx->pool.used`
1091.   }
1092.   
1093. > int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a,
1094.                         const EC_POINT *b, BN_CTX *ctx)
1095.   {

crypto/ec/ecp_smpl.c:1132:12: Call
1130.   
1131.       BN_CTX_start(ctx);
1132.       tmp1 = BN_CTX_get(ctx);
                   ^
1133.       tmp2 = BN_CTX_get(ctx);
1134.       Za23 = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:271:1: Parameter `ctx->pool.used`
  269.   }
  270.   
  271. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  272.   {
  273.       BIGNUM *ret;

crypto/ec/ecp_smpl.c:1133:12: Call
1131.       BN_CTX_start(ctx);
1132.       tmp1 = BN_CTX_get(ctx);
1133.       tmp2 = BN_CTX_get(ctx);
                   ^
1134.       Za23 = BN_CTX_get(ctx);
1135.       Zb23 = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:271:1: Parameter `ctx->pool.used`
  269.   }
  270.   
  271. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  272.   {
  273.       BIGNUM *ret;

crypto/ec/ecp_smpl.c:1134:12: Call
1132.       tmp1 = BN_CTX_get(ctx);
1133.       tmp2 = BN_CTX_get(ctx);
1134.       Za23 = BN_CTX_get(ctx);
                   ^
1135.       Zb23 = BN_CTX_get(ctx);
1136.       if (Zb23 == NULL)

crypto/bn/bn_ctx.c:271:1: Parameter `ctx->pool.used`
  269.   }
  270.   
  271. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  272.   {
  273.       BIGNUM *ret;

crypto/ec/ecp_smpl.c:1135:12: Call
1133.       tmp2 = BN_CTX_get(ctx);
1134.       Za23 = BN_CTX_get(ctx);
1135.       Zb23 = BN_CTX_get(ctx);
                   ^
1136.       if (Zb23 == NULL)
1137.           goto end;

crypto/bn/bn_ctx.c:271:1: Parameter `ctx->pool.used`
  269.   }
  270.   
  271. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  272.   {
  273.       BIGNUM *ret;

crypto/ec/ecp_smpl.c:1196:5: Call
1194.   
1195.    end:
1196.       BN_CTX_end(ctx);
            ^
1197.       BN_CTX_free(new_ctx);
1198.       return ret;

crypto/bn/bn_ctx.c:254:1: Parameter `ctx->pool.used`
  252.   }
  253.   
  254. > void BN_CTX_end(BN_CTX *ctx)
  255.   {
  256.       CTXDBG_ENTRY("BN_CTX_end", ctx);

crypto/bn/bn_ctx.c:263:13: Call
  261.           /* Does this stack frame have anything to release? */
  262.           if (fp < ctx->used)
  263.               BN_POOL_release(&ctx->pool, ctx->used - fp);
                     ^
  264.           ctx->used = fp;
  265.           /* Unjam "too_many" in case "get" had failed */

crypto/bn/bn_ctx.c:399:1: <LHS trace>
397.   }
398.   
399. > static void BN_POOL_release(BN_POOL *p, unsigned int num)
400.   {
401.       unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;

crypto/bn/bn_ctx.c:399:1: Parameter `p->used`
    397.   }
    398.   
    399. > static void BN_POOL_release(BN_POOL *p, unsigned int num)
    400.   {
    401.       unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;

crypto/bn/bn_ctx.c:401:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end` 
    399.   static void BN_POOL_release(BN_POOL *p, unsigned int num)
    400.   {
    401.       unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
               ^
    402.   
    403.       p->used -= num;

static void BN_POOL_release(BN_POOL *p, unsigned int num)
{
    unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
    p->used -= num;
    while (num--) {
        bn_check_top(p->current->vals + offset);
        if (offset == 0) {
            offset = BN_CTX_POOL_SIZE - 1;
            p->current = p->current->prev;
        } else
            offset--;
    }
}
['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}', 'BIGNUM *BN_CTX_get(BN_CTX *ctx)\n{\n    BIGNUM *ret;\n    CTXDBG_ENTRY("BN_CTX_get", ctx);\n    if (ctx->err_stack || ctx->too_many)\n        return NULL;\n    if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) {\n        ctx->too_many = 1;\n        BNerr(BN_F_BN_CTX_GET, BN_R_TOO_MANY_TEMPORARY_VARIABLES);\n        return NULL;\n    }\n    BN_zero(ret);\n    ctx->used++;\n    CTXDBG_RET(ctx, ret);\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 void BN_POOL_release(BN_POOL *p, unsigned int num)\n{\n    unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;\n    p->used -= num;\n    while (num--) {\n        bn_check_top(p->current->vals + offset);\n        if (offset == 0) {\n            offset = BN_CTX_POOL_SIZE - 1;\n            p->current = p->current->prev;\n        } else\n            offset--;\n    }\n}']