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


crypto/ec/ec2_smpl.c:421:1: Parameter `ctx->stack.depth`
419.    * (and additionally fail to cite the EUROCRYPT '92 publication as prior art).
420.    */
421. > int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point,
422.   	const BIGNUM *x_, int y_bit, BN_CTX *ctx)
423.   	{

crypto/ec/ec2_smpl.c:440:2: Call
438.   	y_bit = (y_bit != 0) ? 1 : 0;
439.   
440.   	BN_CTX_start(ctx);
        ^
441.   	tmp = BN_CTX_get(ctx);
442.   	x = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:255:1: Parameter `ctx->stack.depth`
  253.   	}
  254.   
  255. > void BN_CTX_start(BN_CTX *ctx)
  256.   	{
  257.   	CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/ec/ec2_smpl.c:484:2: Call
482.   
483.    err:
484.   	BN_CTX_end(ctx);
        ^
485.   	if (new_ctx != NULL)
486.   		BN_CTX_free(new_ctx);

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

crypto/bn/bn_ctx.c:277:21: Call
  275.   	else
  276.   		{
  277.   		unsigned int fp = BN_STACK_pop(&ctx->stack);
                             ^
  278.   		/* Does this stack frame have anything to release? */
  279.   		if(fp < ctx->used)

crypto/bn/bn_ctx.c:351:1: <LHS trace>
349.   	}
350.   
351. > static unsigned int BN_STACK_pop(BN_STACK *st)
352.   	{
353.   	return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:351:1: Parameter `st->depth`
    349.   	}
    350.   
    351. > static unsigned int BN_STACK_pop(BN_STACK *st)
    352.   	{
    353.   	return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:353:9: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end` 
    351.   static unsigned int BN_STACK_pop(BN_STACK *st)
    352.   	{
    353.   	return st->indexes[--(st->depth)];
                   ^
    354.   	}
    355.   

static unsigned int BN_STACK_pop(BN_STACK *st)
	{
	return st->indexes[--(st->depth)];
	}
['int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group, EC_POINT *point,\n\tconst BIGNUM *x_, int y_bit, BN_CTX *ctx)\n\t{\n\tBN_CTX *new_ctx = NULL;\n\tBIGNUM *tmp, *x, *y, *z;\n\tint ret = 0, z0;\n\tERR_clear_error();\n\tif (ctx == NULL)\n\t\t{\n\t\tctx = new_ctx = BN_CTX_new();\n\t\tif (ctx == NULL)\n\t\t\treturn 0;\n\t\t}\n\ty_bit = (y_bit != 0) ? 1 : 0;\n\tBN_CTX_start(ctx);\n\ttmp = BN_CTX_get(ctx);\n\tx = BN_CTX_get(ctx);\n\ty = BN_CTX_get(ctx);\n\tz = BN_CTX_get(ctx);\n\tif (z == NULL) goto err;\n\tif (!BN_GF2m_mod_arr(x, x_, group->poly)) goto err;\n\tif (BN_is_zero(x))\n\t\t{\n\t\tif (!BN_GF2m_mod_sqrt_arr(y, &group->b, group->poly, ctx)) goto err;\n\t\t}\n\telse\n\t\t{\n\t\tif (!group->meth->field_sqr(group, tmp, x, ctx)) goto err;\n\t\tif (!group->meth->field_div(group, tmp, &group->b, tmp, ctx)) goto err;\n\t\tif (!BN_GF2m_add(tmp, &group->a, tmp)) goto err;\n\t\tif (!BN_GF2m_add(tmp, x, tmp)) goto err;\n\t\tif (!BN_GF2m_mod_solve_quad_arr(z, tmp, group->poly, ctx))\n\t\t\t{\n\t\t\tunsigned long err = ERR_peek_last_error();\n\t\t\tif (ERR_GET_LIB(err) == ERR_LIB_BN && ERR_GET_REASON(err) == BN_R_NO_SOLUTION)\n\t\t\t\t{\n\t\t\t\tERR_clear_error();\n\t\t\t\tECerr(EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES, EC_R_INVALID_COMPRESSED_POINT);\n\t\t\t\t}\n\t\t\telse\n\t\t\t\tECerr(EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES, ERR_R_BN_LIB);\n\t\t\tgoto err;\n\t\t\t}\n\t\tz0 = (BN_is_odd(z)) ? 1 : 0;\n\t\tif (!group->meth->field_mul(group, y, x, z, ctx)) goto err;\n\t\tif (z0 != y_bit)\n\t\t\t{\n\t\t\tif (!BN_GF2m_add(y, y, x)) goto err;\n\t\t\t}\n\t\t}\n\tif (!EC_POINT_set_affine_coordinates_GF2m(group, point, x, y, ctx)) goto err;\n\tret = 1;\n err:\n\tBN_CTX_end(ctx);\n\tif (new_ctx != NULL)\n\t\tBN_CTX_free(new_ctx);\n\treturn ret;\n\t}', 'void BN_CTX_start(BN_CTX *ctx)\n\t{\n\tCTXDBG_ENTRY("BN_CTX_start", ctx);\n\tif(ctx->err_stack || ctx->too_many)\n\t\tctx->err_stack++;\n\telse if(!BN_STACK_push(&ctx->stack, ctx->used))\n\t\t{\n\t\tBNerr(BN_F_BN_CTX_START,BN_R_TOO_MANY_TEMPORARY_VARIABLES);\n\t\tctx->err_stack++;\n\t\t}\n\tCTXDBG_EXIT(ctx);\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 unsigned int BN_STACK_pop(BN_STACK *st)\n\t{\n\treturn st->indexes[--(st->depth)];\n\t}']