crypto/bn/bn_prime.c:596: 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:561:1: Parameter `ctx->stack.depth`
559.   	}
560.   
561. > int bn_probable_prime_dh(BIGNUM *rnd, int bits,
562.   	const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)
563.   	{

crypto/bn/bn_prime.c:567:2: Call
565.   	BIGNUM *t1;
566.   
567.   	BN_CTX_start(ctx);
        ^
568.   	if ((t1 = BN_CTX_get(ctx)) == NULL) goto err;
569.   

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/bn/bn_prime.c:596:2: Call
594.   
595.   err:
596.   	BN_CTX_end(ctx);
        ^
597.   	bn_check_top(rnd);
598.   	return(ret);

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, 2+max(0, ctx->stack.depth)] - 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 bn_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; }\nloop:\n\tfor (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_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}']