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


crypto/bn/bn_recp.c:186:10: Call
184.           goto err;
185.   
186.       if (!BN_div(r, NULL, t, m, ctx))
                ^
187.           goto err;
188.   

crypto/bn/bn_div.c:209:1: Parameter `ctx->pool.used`
  207.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
  208.    */
  209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
  210.              BN_CTX *ctx)
  211.   {

crypto/bn/bn_recp.c:192:5: Call
190.    err:
191.       bn_check_top(r);
192.       BN_CTX_end(ctx);
           ^
193.       return ret;
194.   }

crypto/bn/bn_ctx.c:185:1: Parameter `ctx->pool.used`
  183.   }
  184.   
  185. > void BN_CTX_end(BN_CTX *ctx)
  186.   {
  187.       CTXDBG("ENTER BN_CTX_end()", ctx);

crypto/bn/bn_ctx.c:194:13: Call
  192.           /* Does this stack frame have anything to release? */
  193.           if (fp < ctx->used)
  194.               BN_POOL_release(&ctx->pool, ctx->used - fp);
                     ^
  195.           ctx->used = fp;
  196.           /* Unjam "too_many" in case "get" had failed */

crypto/bn/bn_ctx.c:338:1: <LHS trace>
336.   }
337.   
338. > static void BN_POOL_release(BN_POOL *p, unsigned int num)
339.   {
340.       unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;

crypto/bn/bn_ctx.c:338:1: Parameter `p->used`
    336.   }
    337.   
    338. > static void BN_POOL_release(BN_POOL *p, unsigned int num)
    339.   {
    340.       unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;

crypto/bn/bn_ctx.c:340:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end` 
    338.   static void BN_POOL_release(BN_POOL *p, unsigned int num)
    339.   {
    340.       unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
               ^
    341.   
    342.       p->used -= num;

static void BN_POOL_release(BN_POOL *p, unsigned int num)
{
    unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;
    p->used -= num;
    while (num--) {
        bn_check_top(p->current->vals + offset);
        if (offset == 0) {
            offset = BN_CTX_POOL_SIZE - 1;
            p->current = p->current->prev;
        } else
            offset--;
    }
}
['int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx)\n{\n    int ret = -1;\n    BIGNUM *t;\n    BN_CTX_start(ctx);\n    if ((t = BN_CTX_get(ctx)) == NULL)\n        goto err;\n    if (!BN_set_bit(t, len))\n        goto err;\n    if (!BN_div(r, NULL, t, m, ctx))\n        goto err;\n    ret = len;\n err:\n    bn_check_top(r);\n    BN_CTX_end(ctx);\n    return ret;\n}', 'int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,\n           BN_CTX *ctx)\n{\n    int ret;\n    if (BN_is_zero(divisor)) {\n        BNerr(BN_F_BN_DIV, BN_R_DIV_BY_ZERO);\n        return 0;\n    }\n    if (divisor->d[divisor->top - 1] == 0) {\n        BNerr(BN_F_BN_DIV, BN_R_NOT_INITIALIZED);\n        return 0;\n    }\n    ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);\n    if (ret) {\n        if (dv != NULL)\n            bn_correct_top(dv);\n        if (rm != NULL)\n            bn_correct_top(rm);\n    }\n    return ret;\n}', 'void BN_CTX_end(BN_CTX *ctx)\n{\n    CTXDBG("ENTER 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("LEAVE BN_CTX_end()", ctx);\n}', 'static void BN_POOL_release(BN_POOL *p, unsigned int num)\n{\n    unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE;\n    p->used -= num;\n    while (num--) {\n        bn_check_top(p->current->vals + offset);\n        if (offset == 0) {\n            offset = BN_CTX_POOL_SIZE - 1;\n            p->current = p->current->prev;\n        } else\n            offset--;\n    }\n}']