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


crypto/ec/ec_lib.c:492:1: Parameter `ctx->pool.used`
490.   }
491.   
492. > int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx)
493.   {
494.       int r = 0;

crypto/ec/ec_lib.c:513:10: Call
511.   
512.       BN_CTX_start(ctx);
513.       a1 = BN_CTX_get(ctx);
                ^
514.       a2 = BN_CTX_get(ctx);
515.       a3 = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:284:1: Parameter `ctx->pool.used`
  282.   }
  283.   
  284. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  285.   {
  286.       BIGNUM *ret;

crypto/ec/ec_lib.c:514:10: Call
512.       BN_CTX_start(ctx);
513.       a1 = BN_CTX_get(ctx);
514.       a2 = BN_CTX_get(ctx);
                ^
515.       a3 = BN_CTX_get(ctx);
516.       b1 = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:284:1: Parameter `ctx->pool.used`
  282.   }
  283.   
  284. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  285.   {
  286.       BIGNUM *ret;

crypto/ec/ec_lib.c:515:10: Call
513.       a1 = BN_CTX_get(ctx);
514.       a2 = BN_CTX_get(ctx);
515.       a3 = BN_CTX_get(ctx);
                ^
516.       b1 = BN_CTX_get(ctx);
517.       b2 = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:284:1: Parameter `ctx->pool.used`
  282.   }
  283.   
  284. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  285.   {
  286.       BIGNUM *ret;

crypto/ec/ec_lib.c:516:10: Call
514.       a2 = BN_CTX_get(ctx);
515.       a3 = BN_CTX_get(ctx);
516.       b1 = BN_CTX_get(ctx);
                ^
517.       b2 = BN_CTX_get(ctx);
518.       b3 = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:284:1: Parameter `ctx->pool.used`
  282.   }
  283.   
  284. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  285.   {
  286.       BIGNUM *ret;

crypto/ec/ec_lib.c:517:10: Call
515.       a3 = BN_CTX_get(ctx);
516.       b1 = BN_CTX_get(ctx);
517.       b2 = BN_CTX_get(ctx);
                ^
518.       b3 = BN_CTX_get(ctx);
519.       if (!b3) {

crypto/bn/bn_ctx.c:284:1: Parameter `ctx->pool.used`
  282.   }
  283.   
  284. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  285.   {
  286.       BIGNUM *ret;

crypto/ec/ec_lib.c:518:10: Call
516.       b1 = BN_CTX_get(ctx);
517.       b2 = BN_CTX_get(ctx);
518.       b3 = BN_CTX_get(ctx);
                ^
519.       if (!b3) {
520.           BN_CTX_end(ctx);

crypto/bn/bn_ctx.c:284:1: Parameter `ctx->pool.used`
  282.   }
  283.   
  284. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  285.   {
  286.       BIGNUM *ret;

crypto/ec/ec_lib.c:520:9: Call
518.       b3 = BN_CTX_get(ctx);
519.       if (!b3) {
520.           BN_CTX_end(ctx);
               ^
521.           if (ctx_new)
522.               BN_CTX_free(ctx);

crypto/bn/bn_ctx.c:267:1: Parameter `ctx->pool.used`
  265.   }
  266.   
  267. > void BN_CTX_end(BN_CTX *ctx)
  268.   {
  269.       CTXDBG_ENTRY("BN_CTX_end", ctx);

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

crypto/bn/bn_ctx.c:435:1: <LHS trace>
433.   }
434.   
435. > static void BN_POOL_release(BN_POOL *p, unsigned int num)
436.   {
437.       unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;

crypto/bn/bn_ctx.c:435:1: Parameter `p->used`
    433.   }
    434.   
    435. > static void BN_POOL_release(BN_POOL *p, unsigned int num)
    436.   {
    437.       unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;

crypto/bn/bn_ctx.c:437:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end` 
    435.   static void BN_POOL_release(BN_POOL *p, unsigned int num)
    436.   {
    437.       unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
               ^
    438.       p->used -= num;
    439.       while (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) {
            offset = BN_CTX_POOL_SIZE - 1;
            p->current = p->current->prev;
        } else
            offset--;
    }
}
['int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ctx)\n{\n    int r = 0;\n    BIGNUM *a1, *a2, *a3, *b1, *b2, *b3;\n    BN_CTX *ctx_new = NULL;\n    if (EC_METHOD_get_field_type(EC_GROUP_method_of(a)) !=\n        EC_METHOD_get_field_type(EC_GROUP_method_of(b)))\n        return 1;\n    if (EC_GROUP_get_curve_name(a) && EC_GROUP_get_curve_name(b) &&\n        EC_GROUP_get_curve_name(a) != EC_GROUP_get_curve_name(b))\n        return 1;\n    if (!ctx)\n        ctx_new = ctx = BN_CTX_new();\n    if (!ctx)\n        return -1;\n    BN_CTX_start(ctx);\n    a1 = BN_CTX_get(ctx);\n    a2 = BN_CTX_get(ctx);\n    a3 = BN_CTX_get(ctx);\n    b1 = BN_CTX_get(ctx);\n    b2 = BN_CTX_get(ctx);\n    b3 = BN_CTX_get(ctx);\n    if (!b3) {\n        BN_CTX_end(ctx);\n        if (ctx_new)\n            BN_CTX_free(ctx);\n        return -1;\n    }\n    if (!a->meth->group_get_curve(a, a1, a2, a3, ctx) ||\n        !b->meth->group_get_curve(b, b1, b2, b3, ctx))\n        r = 1;\n    if (r || BN_cmp(a1, b1) || BN_cmp(a2, b2) || BN_cmp(a3, b3))\n        r = 1;\n    if (r || EC_POINT_cmp(a, EC_GROUP_get0_generator(a),\n                          EC_GROUP_get0_generator(b), ctx))\n        r = 1;\n    if (!r) {\n        if (!EC_GROUP_get_order(a, a1, ctx) ||\n            !EC_GROUP_get_order(b, b1, ctx) ||\n            !EC_GROUP_get_cofactor(a, a2, ctx) ||\n            !EC_GROUP_get_cofactor(b, b2, ctx)) {\n            BN_CTX_end(ctx);\n            if (ctx_new)\n                BN_CTX_free(ctx);\n            return -1;\n        }\n        if (BN_cmp(a1, b1) || BN_cmp(a2, b2))\n            r = 1;\n    }\n    BN_CTX_end(ctx);\n    if (ctx_new)\n        BN_CTX_free(ctx);\n    return r;\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)) == 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) {\n            offset = BN_CTX_POOL_SIZE - 1;\n            p->current = p->current->prev;\n        } else\n            offset--;\n    }\n}']