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


crypto/ec/ecp_smpl.c:637:1: Parameter `ctx->stack.depth`
635.   	}
636.   
637. > int ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx)
638.   	{
639.   	int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, BN_CTX *);

crypto/ec/ecp_smpl.c:664:2: Call
662.   		}
663.   
664.   	BN_CTX_start(ctx);
        ^
665.   	n0 = BN_CTX_get(ctx);
666.   	n1 = BN_CTX_get(ctx);

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

crypto/ec/ecp_smpl.c:728:4: Call
726.   			{
727.   			/* a is the same point as b */
728.   			BN_CTX_end(ctx);
          ^
729.   			ret = EC_POINT_dbl(group, r, a, ctx);
730.   			ctx = NULL;

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

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

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

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

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

static unsigned int BN_STACK_pop(BN_STACK *st)
	{
	return st->indexes[--(st->depth)];
	}
['int ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx)\n\t{\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\tconst BIGNUM *p;\n\tBN_CTX *new_ctx = NULL;\n\tBIGNUM *n0, *n1, *n2, *n3, *n4, *n5, *n6;\n\tint ret = 0;\n\tif (a == b)\n\t\treturn EC_POINT_dbl(group, r, a, ctx);\n\tif (EC_POINT_is_at_infinity(group, a))\n\t\treturn EC_POINT_copy(r, b);\n\tif (EC_POINT_is_at_infinity(group, b))\n\t\treturn EC_POINT_copy(r, a);\n\tfield_mul = group->meth->field_mul;\n\tfield_sqr = group->meth->field_sqr;\n\tp = &group->field;\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\tBN_CTX_start(ctx);\n\tn0 = BN_CTX_get(ctx);\n\tn1 = BN_CTX_get(ctx);\n\tn2 = BN_CTX_get(ctx);\n\tn3 = BN_CTX_get(ctx);\n\tn4 = BN_CTX_get(ctx);\n\tn5 = BN_CTX_get(ctx);\n\tn6 = BN_CTX_get(ctx);\n\tif (n6 == NULL) goto end;\n\tif (b->Z_is_one)\n\t\t{\n\t\tif (!BN_copy(n1, &a->X)) goto end;\n\t\tif (!BN_copy(n2, &a->Y)) goto end;\n\t\t}\n\telse\n\t\t{\n\t\tif (!field_sqr(group, n0, &b->Z, ctx)) goto end;\n\t\tif (!field_mul(group, n1, &a->X, n0, ctx)) goto end;\n\t\tif (!field_mul(group, n0, n0, &b->Z, ctx)) goto end;\n\t\tif (!field_mul(group, n2, &a->Y, n0, ctx)) goto end;\n\t\t}\n\tif (a->Z_is_one)\n\t\t{\n\t\tif (!BN_copy(n3, &b->X)) goto end;\n\t\tif (!BN_copy(n4, &b->Y)) goto end;\n\t\t}\n\telse\n\t\t{\n\t\tif (!field_sqr(group, n0, &a->Z, ctx)) goto end;\n\t\tif (!field_mul(group, n3, &b->X, n0, ctx)) goto end;\n\t\tif (!field_mul(group, n0, n0, &a->Z, ctx)) goto end;\n\t\tif (!field_mul(group, n4, &b->Y, n0, ctx)) goto end;\n\t\t}\n\tif (!BN_mod_sub_quick(n5, n1, n3, p)) goto end;\n\tif (!BN_mod_sub_quick(n6, n2, n4, p)) goto end;\n\tif (BN_is_zero(n5))\n\t\t{\n\t\tif (BN_is_zero(n6))\n\t\t\t{\n\t\t\tBN_CTX_end(ctx);\n\t\t\tret = EC_POINT_dbl(group, r, a, ctx);\n\t\t\tctx = NULL;\n\t\t\tgoto end;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tBN_zero(&r->Z);\n\t\t\tr->Z_is_one = 0;\n\t\t\tret = 1;\n\t\t\tgoto end;\n\t\t\t}\n\t\t}\n\tif (!BN_mod_add_quick(n1, n1, n3, p)) goto end;\n\tif (!BN_mod_add_quick(n2, n2, n4, p)) goto end;\n\tif (a->Z_is_one && b->Z_is_one)\n\t\t{\n\t\tif (!BN_copy(&r->Z, n5)) goto end;\n\t\t}\n\telse\n\t\t{\n\t\tif (a->Z_is_one)\n\t\t\t{ if (!BN_copy(n0, &b->Z)) goto end; }\n\t\telse if (b->Z_is_one)\n\t\t\t{ if (!BN_copy(n0, &a->Z)) goto end; }\n\t\telse\n\t\t\t{ if (!field_mul(group, n0, &a->Z, &b->Z, ctx)) goto end; }\n\t\tif (!field_mul(group, &r->Z, n0, n5, ctx)) goto end;\n\t\t}\n\tr->Z_is_one = 0;\n\tif (!field_sqr(group, n0, n6, ctx)) goto end;\n\tif (!field_sqr(group, n4, n5, ctx)) goto end;\n\tif (!field_mul(group, n3, n1, n4, ctx)) goto end;\n\tif (!BN_mod_sub_quick(&r->X, n0, n3, p)) goto end;\n\tif (!BN_mod_lshift1_quick(n0, &r->X, p)) goto end;\n\tif (!BN_mod_sub_quick(n0, n3, n0, p)) goto end;\n\tif (!field_mul(group, n0, n0, n6, ctx)) goto end;\n\tif (!field_mul(group, n5, n4, n5, ctx)) goto end;\n\tif (!field_mul(group, n1, n2, n5, ctx)) goto end;\n\tif (!BN_mod_sub_quick(n0, n0, n1, p)) goto end;\n\tif (BN_is_odd(n0))\n\t\tif (!BN_add(n0, n0, p)) goto end;\n\tif (!BN_rshift1(&r->Y, n0)) goto end;\n\tret = 1;\n end:\n\tif (ctx)\n\t\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}']