crypto/bn/bn_prime.c:400: 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:356:1: Parameter `ctx->stack.depth`
354.   }
355.   
356. > int bn_probable_prime_dh(BIGNUM *rnd, int bits,
357.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)
358.   {

crypto/bn/bn_prime.c:362:5: Call
360.       BIGNUM *t1;
361.   
362.       BN_CTX_start(ctx);
           ^
363.       if ((t1 = BN_CTX_get(ctx)) == NULL)
364.           goto err;

crypto/bn/bn_ctx.c:181:1: Parameter `ctx->stack.depth`
  179.   }
  180.   
  181. > void BN_CTX_start(BN_CTX *ctx)
  182.   {
  183.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_prime.c:400:5: Call
398.   
399.    err:
400.       BN_CTX_end(ctx);
           ^
401.       bn_check_top(rnd);
402.       return ret;

crypto/bn/bn_ctx.c:195:1: Parameter `ctx->stack.depth`
  193.   }
  194.   
  195. > void BN_CTX_end(BN_CTX *ctx)
  196.   {
  197.       CTXDBG_ENTRY("BN_CTX_end", ctx);

crypto/bn/bn_ctx.c:201:27: Call
  199.           ctx->err_stack--;
  200.       else {
  201.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                   ^
  202.           /* Does this stack frame have anything to release? */
  203.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:271:1: <LHS trace>
269.   }
270.   
271. > static unsigned int BN_STACK_pop(BN_STACK *st)
272.   {
273.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:271:1: Parameter `st->depth`
    269.   }
    270.   
    271. > static unsigned int BN_STACK_pop(BN_STACK *st)
    272.   {
    273.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:273:12: Binary operation: ([0, 2+max(0, ctx->stack.depth)] - 1):unsigned32 by call to `BN_CTX_end` 
    271.   static unsigned int BN_STACK_pop(BN_STACK *st)
    272.   {
    273.       return st->indexes[--(st->depth)];
                      ^
    274.   }
    275.   

static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['int bn_probable_prime_dh(BIGNUM *rnd, int bits,\n                         const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)\n{\n    int i, ret = 0;\n    BIGNUM *t1;\n    BN_CTX_start(ctx);\n    if ((t1 = BN_CTX_get(ctx)) == NULL)\n        goto err;\n    if (!BN_priv_rand(rnd, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD))\n        goto err;\n    if (!BN_mod(t1, rnd, add, ctx))\n        goto err;\n    if (!BN_sub(rnd, rnd, t1))\n        goto err;\n    if (rem == NULL) {\n        if (!BN_add_word(rnd, 1))\n            goto err;\n    } else {\n        if (!BN_add(rnd, rnd, rem))\n            goto err;\n    }\n loop:\n    for (i = 1; i < NUMPRIMES; i++) {\n        BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]);\n        if (mod == (BN_ULONG)-1)\n            goto err;\n        if (mod <= 1) {\n            if (!BN_add(rnd, rnd, add))\n                goto err;\n            goto loop;\n        }\n    }\n    ret = 1;\n err:\n    BN_CTX_end(ctx);\n    bn_check_top(rnd);\n    return ret;\n}', 'void BN_CTX_start(BN_CTX *ctx)\n{\n    CTXDBG_ENTRY("BN_CTX_start", ctx);\n    if (ctx->err_stack || ctx->too_many)\n        ctx->err_stack++;\n    else if (!BN_STACK_push(&ctx->stack, ctx->used)) {\n        BNerr(BN_F_BN_CTX_START, BN_R_TOO_MANY_TEMPORARY_VARIABLES);\n        ctx->err_stack++;\n    }\n    CTXDBG_EXIT(ctx);\n}', 'void BN_CTX_end(BN_CTX *ctx)\n{\n    CTXDBG_ENTRY("BN_CTX_end", ctx);\n    if (ctx->err_stack)\n        ctx->err_stack--;\n    else {\n        unsigned int fp = BN_STACK_pop(&ctx->stack);\n        if (fp < ctx->used)\n            BN_POOL_release(&ctx->pool, ctx->used - fp);\n        ctx->used = fp;\n        ctx->too_many = 0;\n    }\n    CTXDBG_EXIT(ctx);\n}', 'static unsigned int BN_STACK_pop(BN_STACK *st)\n{\n    return st->indexes[--(st->depth)];\n}']