crypto/ec/ecp_smpl.c:1307: 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:1175:1: Parameter `ctx->stack.depth`
1173.   
1174.   
1175. > int ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx)
1176.   	{
1177.   	BN_CTX *new_ctx = NULL;

crypto/ec/ecp_smpl.c:1193:2: Call
1191.   		}
1192.   
1193.   	BN_CTX_start(ctx);
         ^
1194.   	tmp = BN_CTX_get(ctx);
1195.   	tmp_Z = 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:1307:2: Call
1305.   
1306.    err:
1307.   	BN_CTX_end(ctx);
         ^
1308.   	if (new_ctx != NULL)
1309.   		BN_CTX_free(new_ctx);

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_points_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx)\n\t{\n\tBN_CTX *new_ctx = NULL;\n\tBIGNUM *tmp, *tmp_Z;\n\tBIGNUM **prod_Z = NULL;\n\tsize_t i;\n\tint ret = 0;\n\tif (num == 0)\n\t\treturn 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 0;\n\t\t}\n\tBN_CTX_start(ctx);\n\ttmp = BN_CTX_get(ctx);\n\ttmp_Z = BN_CTX_get(ctx);\n\tif (tmp == NULL || tmp_Z == NULL) goto err;\n\tprod_Z = OPENSSL_malloc(num * sizeof prod_Z[0]);\n\tif (prod_Z == NULL) goto err;\n\tfor (i = 0; i < num; i++)\n\t\t{\n\t\tprod_Z[i] = BN_new();\n\t\tif (prod_Z[i] == NULL) goto err;\n\t\t}\n\tif (!BN_is_zero(&points[0]->Z))\n\t\t{\n\t\tif (!BN_copy(prod_Z[0], &points[0]->Z)) goto err;\n\t\t}\n\telse\n\t\t{\n\t\tif (group->meth->field_set_to_one != 0)\n\t\t\t{\n\t\t\tif (!group->meth->field_set_to_one(group, prod_Z[0], ctx)) goto err;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (!BN_one(prod_Z[0])) goto err;\n\t\t\t}\n\t\t}\n\tfor (i = 1; i < num; i++)\n\t\t{\n\t\tif (!BN_is_zero(&points[i]->Z))\n\t\t\t{\n\t\t\tif (!group->meth->field_mul(group, prod_Z[i], prod_Z[i - 1], &points[i]->Z, ctx)) goto err;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (!BN_copy(prod_Z[i], prod_Z[i - 1])) goto err;\n\t\t\t}\n\t\t}\n\tif (!BN_mod_inverse(tmp, prod_Z[num - 1], &group->field, ctx))\n\t\t{\n\t\tECerr(EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE, ERR_R_BN_LIB);\n\t\tgoto err;\n\t\t}\n\tif (group->meth->field_encode != 0)\n\t\t{\n\t\tif (!group->meth->field_encode(group, tmp, tmp, ctx)) goto err;\n\t\tif (!group->meth->field_encode(group, tmp, tmp, ctx)) goto err;\n\t\t}\n\tfor (i = num - 1; i > 0; --i)\n\t\t{\n\t\tif (!BN_is_zero(&points[i]->Z))\n\t\t\t{\n\t\t\tif (!group->meth->field_mul(group, tmp_Z, prod_Z[i - 1], tmp, ctx)) goto err;\n\t\t\tif (!group->meth->field_mul(group, tmp, tmp, &points[i]->Z, ctx)) goto err;\n\t\t\tif (!BN_copy(&points[i]->Z, tmp_Z)) goto err;\n\t\t\t}\n\t\t}\n\tif (!BN_is_zero(&points[0]->Z))\n\t\t{\n\t\tif (!BN_copy(&points[0]->Z, tmp)) goto err;\n\t\t}\n\tfor (i = 0; i < num; i++)\n\t\t{\n\t\tEC_POINT *p = points[i];\n\t\tif (!BN_is_zero(&p->Z))\n\t\t\t{\n\t\t\tif (!group->meth->field_sqr(group, tmp, &p->Z, ctx)) goto err;\n\t\t\tif (!group->meth->field_mul(group, &p->X, &p->X, tmp, ctx)) goto err;\n\t\t\tif (!group->meth->field_mul(group, tmp, tmp, &p->Z, ctx)) goto err;\n\t\t\tif (!group->meth->field_mul(group, &p->Y, &p->Y, tmp, ctx)) goto err;\n\t\t\tif (group->meth->field_set_to_one != 0)\n\t\t\t\t{\n\t\t\t\tif (!group->meth->field_set_to_one(group, &p->Z, ctx)) goto err;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tif (!BN_one(&p->Z)) goto err;\n\t\t\t\t}\n\t\t\tp->Z_is_one = 1;\n\t\t\t}\n\t\t}\n\tret = 1;\n err:\n\tBN_CTX_end(ctx);\n\tif (new_ctx != NULL)\n\t\tBN_CTX_free(new_ctx);\n\tif (prod_Z != NULL)\n\t\t{\n\t\tfor (i = 0; i < num; i++)\n\t\t\t{\n\t\t\tif (prod_Z[i] != NULL)\n\t\t\t\tBN_clear_free(prod_Z[i]);\n\t\t\t}\n\t\tOPENSSL_free(prod_Z);\n\t\t}\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}']