crypto/bn/bn_prime.c:436: error: INTEGER_OVERFLOW_L2
  ([0, 2+max(0, `ctx->stack.depth`)] - 1):unsigned32 by call to `BN_CTX_end`.
Showing all 9 steps of the trace


crypto/bn/bn_prime.c:403:1: Parameter `ctx->stack.depth`
401.   	}
402.   
403. > static int probable_prime_dh(BIGNUM *rnd, int bits,
404.   	const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)
405.   	{

crypto/bn/bn_prime.c:409:2: Call
407.   	BIGNUM *t1;
408.   
409.   	BN_CTX_start(ctx);
        ^
410.   	if ((t1 = BN_CTX_get(ctx)) == NULL) goto err;
411.   

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

crypto/bn/bn_prime.c:436:2: Call
434.   	ret=1;
435.   err:
436.   	BN_CTX_end(ctx);
        ^
437.   	bn_check_top(rnd);
438.   	return(ret);

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, 2+max(0, ctx->stack.depth)] - 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)];
	}
['static int probable_prime_dh(BIGNUM *rnd, int bits,\n\tconst BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)\n\t{\n\tint i,ret=0;\n\tBIGNUM *t1;\n\tBN_CTX_start(ctx);\n\tif ((t1 = BN_CTX_get(ctx)) == NULL) goto err;\n\tif (!BN_rand(rnd,bits,0,1)) goto err;\n\tif (!BN_mod(t1,rnd,add,ctx)) goto err;\n\tif (!BN_sub(rnd,rnd,t1)) goto err;\n\tif (rem == NULL)\n\t\t{ if (!BN_add_word(rnd,1)) goto err; }\n\telse\n\t\t{ if (!BN_add(rnd,rnd,rem)) goto err; }\n\tloop: for (i=1; i<NUMPRIMES; i++)\n\t\t{\n\t\tif (BN_mod_word(rnd,(BN_ULONG)primes[i]) <= 1)\n\t\t\t{\n\t\t\tif (!BN_add(rnd,rnd,add)) goto err;\n\t\t\tgoto loop;\n\t\t\t}\n\t\t}\n\tret=1;\nerr:\n\tBN_CTX_end(ctx);\n\tbn_check_top(rnd);\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_GET,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}']