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


crypto/ec/ec2_smpl.c:870:1: Parameter `ctx->pool.used`
868.    *   1   not equal
869.    */
870. > int ec_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx)
871.   	{
872.   	BIGNUM *aX, *aY, *bX, *bY;

crypto/ec/ec2_smpl.c:894:7: Call
892.   
893.   	BN_CTX_start(ctx);
894.   	aX = BN_CTX_get(ctx);
             ^
895.   	aY = BN_CTX_get(ctx);
896.   	bX = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used`
  286.   	}
  287.   
  288. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  289.   	{
  290.   	BIGNUM *ret;

crypto/ec/ec2_smpl.c:895:7: Call
893.   	BN_CTX_start(ctx);
894.   	aX = BN_CTX_get(ctx);
895.   	aY = BN_CTX_get(ctx);
             ^
896.   	bX = BN_CTX_get(ctx);
897.   	bY = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used`
  286.   	}
  287.   
  288. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  289.   	{
  290.   	BIGNUM *ret;

crypto/ec/ec2_smpl.c:896:7: Call
894.   	aX = BN_CTX_get(ctx);
895.   	aY = BN_CTX_get(ctx);
896.   	bX = BN_CTX_get(ctx);
             ^
897.   	bY = BN_CTX_get(ctx);
898.   	if (bY == NULL) goto err;

crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used`
  286.   	}
  287.   
  288. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  289.   	{
  290.   	BIGNUM *ret;

crypto/ec/ec2_smpl.c:897:7: Call
895.   	aY = BN_CTX_get(ctx);
896.   	bX = BN_CTX_get(ctx);
897.   	bY = BN_CTX_get(ctx);
             ^
898.   	if (bY == NULL) goto err;
899.   

crypto/bn/bn_ctx.c:288:1: Parameter `ctx->pool.used`
  286.   	}
  287.   
  288. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  289.   	{
  290.   	BIGNUM *ret;

crypto/ec/ec2_smpl.c:905:11: Call
903.   
904.     err:	
905.   	if (ctx) BN_CTX_end(ctx);
                 ^
906.   	if (new_ctx) BN_CTX_free(new_ctx);
907.   	return ret;

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

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

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

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

crypto/bn/bn_ctx.c:440:2: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end` 
    438.   static void BN_POOL_release(BN_POOL *p, unsigned int num)
    439.   	{
    440.   	unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
            ^
    441.   	p->used -= num;
    442.   	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_GF2m_simple_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx)\n\t{\n\tBIGNUM *aX, *aY, *bX, *bY;\n\tBN_CTX *new_ctx = NULL;\n\tint ret = -1;\n\tif (EC_POINT_is_at_infinity(group, a))\n\t\t{\n\t\treturn EC_POINT_is_at_infinity(group, b) ? 0 : 1;\n\t\t}\n\tif (a->Z_is_one && b->Z_is_one)\n\t\t{\n\t\treturn ((BN_cmp(&a->X, &b->X) == 0) && BN_cmp(&a->Y, &b->Y) == 0) ? 0 : 1;\n\t\t}\n\tif (ctx == NULL)\n\t\t{\n\t\tctx = new_ctx = BN_CTX_new();\n\t\tif (ctx == NULL)\n\t\t\treturn -1;\n\t\t}\n\tBN_CTX_start(ctx);\n\taX = BN_CTX_get(ctx);\n\taY = BN_CTX_get(ctx);\n\tbX = BN_CTX_get(ctx);\n\tbY = BN_CTX_get(ctx);\n\tif (bY == NULL) goto err;\n\tif (!EC_POINT_get_affine_coordinates_GF2m(group, a, aX, aY, ctx)) goto err;\n\tif (!EC_POINT_get_affine_coordinates_GF2m(group, b, bX, bY, ctx)) goto err;\n\tret = ((BN_cmp(aX, bX) == 0) && BN_cmp(aY, bY) == 0) ? 0 : 1;\n  err:\n\tif (ctx) BN_CTX_end(ctx);\n\tif (new_ctx) BN_CTX_free(new_ctx);\n\treturn ret;\n\t}', 'BIGNUM *BN_CTX_get(BN_CTX *ctx)\n\t{\n\tBIGNUM *ret;\n\tCTXDBG_ENTRY("BN_CTX_get", ctx);\n\tif(ctx->err_stack || ctx->too_many) return NULL;\n\tif((ret = BN_POOL_get(&ctx->pool)) == NULL)\n\t\t{\n\t\tctx->too_many = 1;\n\t\tBNerr(BN_F_BN_CTX_GET,BN_R_TOO_MANY_TEMPORARY_VARIABLES);\n\t\treturn NULL;\n\t\t}\n\tBN_zero(ret);\n\tctx->used++;\n\tCTXDBG_RET(ctx, ret);\n\treturn ret;\n\t}', 'void BN_CTX_end(BN_CTX *ctx)\n\t{\n\tCTXDBG_ENTRY("BN_CTX_end", ctx);\n\tif(ctx->err_stack)\n\t\tctx->err_stack--;\n\telse\n\t\t{\n\t\tunsigned int fp = BN_STACK_pop(&ctx->stack);\n\t\tif(fp < ctx->used)\n\t\t\tBN_POOL_release(&ctx->pool, ctx->used - fp);\n\t\tctx->used = fp;\n\t\tctx->too_many = 0;\n\t\t}\n\tCTXDBG_EXIT(ctx);\n\t}', 'static void BN_POOL_release(BN_POOL *p, unsigned int num)\n\t{\n\tunsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;\n\tp->used -= num;\n\twhile(num--)\n\t\t{\n\t\tbn_check_top(p->current->vals + offset);\n\t\tif(!offset)\n\t\t\t{\n\t\t\toffset = BN_CTX_POOL_SIZE - 1;\n\t\t\tp->current = p->current->prev;\n\t\t\t}\n\t\telse\n\t\t\toffset--;\n\t\t}\n\t}']