crypto/rsa/rsa_x931g.c:208: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned32 by call to `BN_X931_generate_Xpq`.
Showing all 12 steps of the trace


crypto/rsa/rsa_x931g.c:205:5: Call
203.           goto error;
204.   
205.       BN_CTX_start(ctx);
           ^
206.       Xp = BN_CTX_get(ctx);
207.       Xq = 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/rsa/rsa_x931g.c:208:10: Call
206.       Xp = BN_CTX_get(ctx);
207.       Xq = BN_CTX_get(ctx);
208.       if (!BN_X931_generate_Xpq(Xp, Xq, bits, ctx))
                ^
209.           goto error;
210.   

crypto/bn/bn_x931p.c:200:1: Parameter `ctx->stack.depth`
  198.    */
  199.   
  200. > int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
  201.   {
  202.       BIGNUM *t;

crypto/bn/bn_x931p.c:219:5: Call
  217.           return 0;
  218.   
  219.       BN_CTX_start(ctx);
             ^
  220.       t = BN_CTX_get(ctx);
  221.   

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:231:5: Call
  229.       }
  230.   
  231.       BN_CTX_end(ctx);
             ^
  232.   
  233.       if (i < 1000)

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_X931_generate_Xpq` 
      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 RSA_X931_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e,\n                             BN_GENCB *cb)\n{\n    int ok = 0;\n    BIGNUM *Xp = NULL, *Xq = NULL;\n    BN_CTX *ctx = NULL;\n    ctx = BN_CTX_new();\n    if (!ctx)\n        goto error;\n    BN_CTX_start(ctx);\n    Xp = BN_CTX_get(ctx);\n    Xq = BN_CTX_get(ctx);\n    if (!BN_X931_generate_Xpq(Xp, Xq, bits, ctx))\n        goto error;\n    rsa->p = BN_new();\n    rsa->q = BN_new();\n    if (!rsa->p || !rsa->q)\n        goto error;\n    if (!BN_X931_generate_prime_ex(rsa->p, NULL, NULL, NULL, NULL, Xp,\n                                   e, ctx, cb))\n        goto error;\n    if (!BN_X931_generate_prime_ex(rsa->q, NULL, NULL, NULL, NULL, Xq,\n                                   e, ctx, cb))\n        goto error;\n    if (!RSA_X931_derive_ex(rsa, NULL, NULL, NULL, NULL,\n                            NULL, NULL, NULL, NULL, NULL, NULL, e, cb))\n        goto error;\n    ok = 1;\n error:\n    if (ctx) {\n        BN_CTX_end(ctx);\n        BN_CTX_free(ctx);\n    }\n    if (ok)\n        return 1;\n    return 0;\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}', 'int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)\n{\n    BIGNUM *t;\n    int i;\n    if ((nbits < 1024) || (nbits & 0xff))\n        return 0;\n    nbits >>= 1;\n    if (!BN_rand(Xp, nbits, 1, 0))\n        return 0;\n    BN_CTX_start(ctx);\n    t = BN_CTX_get(ctx);\n    for (i = 0; i < 1000; i++) {\n        if (!BN_rand(Xq, nbits, 1, 0))\n            return 0;\n        BN_sub(t, Xp, Xq);\n        if (BN_num_bits(t) > (nbits - 100))\n            break;\n    }\n    BN_CTX_end(ctx);\n    if (i < 1000)\n        return 1;\n    return 0;\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}']