crypto/bn/bn_x931p.c:271: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end`.
Showing all 9 steps of the trace


crypto/bn/bn_x931p.c:248:1: Parameter `ctx->stack.depth`
246.    */
247.   
248. > int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
249.                                 BIGNUM *Xp1, BIGNUM *Xp2,
250.                                 const BIGNUM *Xp,

crypto/bn/bn_x931p.c:255:5: Call
253.       int ret = 0;
254.   
255.       BN_CTX_start(ctx);
           ^
256.       if (!Xp1)
257.           Xp1 = BN_CTX_get(ctx);

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_x931p.c:271:5: Call
269.   
270.    error:
271.       BN_CTX_end(ctx);
           ^
272.   
273.       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, +oo] - 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_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,\n                              BIGNUM *Xp1, BIGNUM *Xp2,\n                              const BIGNUM *Xp,\n                              const BIGNUM *e, BN_CTX *ctx, BN_GENCB *cb)\n{\n    int ret = 0;\n    BN_CTX_start(ctx);\n    if (!Xp1)\n        Xp1 = BN_CTX_get(ctx);\n    if (!Xp2)\n        Xp2 = BN_CTX_get(ctx);\n    if (!BN_rand(Xp1, 101, 0, 0))\n        goto error;\n    if (!BN_rand(Xp2, 101, 0, 0))\n        goto error;\n    if (!BN_X931_derive_prime_ex(p, p1, p2, Xp, Xp1, Xp2, e, ctx, cb))\n        goto error;\n    ret = 1;\n error:\n    BN_CTX_end(ctx);\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}']