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


crypto/ec/ec2_smpl.c:544:1: Parameter `ctx->pool.used`
542.    *      y^2 + x*y = x^3 + a*x^2 + b.
543.    */
544. > int ec_GF2m_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx)
545.   	{
546.   	int ret = -1;

crypto/ec/ec2_smpl.c:569:7: Call
567.   
568.   	BN_CTX_start(ctx);
569.   	y2 = BN_CTX_get(ctx);
             ^
570.   	lh = BN_CTX_get(ctx);
571.   	if (lh == NULL) goto err;

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

crypto/ec/ec2_smpl.c:570:7: Call
568.   	BN_CTX_start(ctx);
569.   	y2 = BN_CTX_get(ctx);
570.   	lh = BN_CTX_get(ctx);
             ^
571.   	if (lh == NULL) goto err;
572.   

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

crypto/ec/ec2_smpl.c:587:11: Call
585.   	ret = BN_is_zero(lh);
586.    err:
587.   	if (ctx) BN_CTX_end(ctx);
                 ^
588.   	if (new_ctx) BN_CTX_free(new_ctx);
589.   	return ret;

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

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

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

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

crypto/bn/bn_ctx.c:442:2: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end` 
    440.   static void BN_POOL_release(BN_POOL *p, unsigned int num)
    441.   	{
    442.   	unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
            ^
    443.   	p->used -= num;
    444.   	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_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx)\n\t{\n\tint ret = -1;\n\tBN_CTX *new_ctx = NULL;\n\tBIGNUM *lh, *y2;\n\tint (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *);\n\tint (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *);\n\tif (EC_POINT_is_at_infinity(group, point))\n\t\treturn 1;\n\tfield_mul = group->meth->field_mul;\n\tfield_sqr = group->meth->field_sqr;\n\tif (!point->Z_is_one) return -1;\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\ty2 = BN_CTX_get(ctx);\n\tlh = BN_CTX_get(ctx);\n\tif (lh == NULL) goto err;\n\tif (!BN_GF2m_add(lh, &point->X, &group->a)) goto err;\n\tif (!field_mul(group, lh, lh, &point->X, ctx)) goto err;\n\tif (!BN_GF2m_add(lh, lh, &point->Y)) goto err;\n\tif (!field_mul(group, lh, lh, &point->X, ctx)) goto err;\n\tif (!BN_GF2m_add(lh, lh, &group->b)) goto err;\n\tif (!field_sqr(group, y2, &point->Y, ctx)) goto err;\n\tif (!BN_GF2m_add(lh, lh, y2)) goto err;\n\tret = BN_is_zero(lh);\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}']