crypto/bn/bn_prime.c:612: 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:571:1: Parameter `ctx->stack.depth`
569.   }
570.   
571. > int bn_probable_prime_dh(BIGNUM *rnd, int bits,
572.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx)
573.   {

crypto/bn/bn_prime.c:577:5: Call
575.       BIGNUM *t1;
576.   
577.       BN_CTX_start(ctx);
           ^
578.       if ((t1 = BN_CTX_get(ctx)) == NULL)
579.           goto err;

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

crypto/bn/bn_prime.c:612:5: Call
610.   
611.    err:
612.       BN_CTX_end(ctx);
           ^
613.       bn_check_top(rnd);
614.       return (ret);

crypto/bn/bn_ctx.c:267:1: Parameter `ctx->stack.depth`
  265.   }
  266.   
  267. > void BN_CTX_end(BN_CTX *ctx)
  268.   {
  269.       CTXDBG_ENTRY("BN_CTX_end", ctx);

crypto/bn/bn_ctx.c:273:27: Call
  271.           ctx->err_stack--;
  272.       else {
  273.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                   ^
  274.           /* Does this stack frame have anything to release? */
  275.           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:12: 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)];
}
['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_rand(rnd, bits, 0, 1))\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        if (BN_mod_word(rnd, (BN_ULONG)primes[i]) <= 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}']