crypto/bn/bn_gf2m.c:782: error: INTEGER_OVERFLOW_L2
  ([0, 5+max(0, `ctx->stack.depth`)] - 1):unsigned32 by call to `BN_CTX_end`.
Showing all 11 steps of the trace


crypto/bn/bn_gf2m.c:765:1: Parameter `ctx->stack.depth`
763.    * use the BN_GF2m_mod_inv function.
764.    */
765. > int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *xx, const int p[],
766.                           BN_CTX *ctx)
767.   {

crypto/bn/bn_gf2m.c:772:5: Call
770.   
771.       bn_check_top(xx);
772.       BN_CTX_start(ctx);
           ^
773.       if ((field = BN_CTX_get(ctx)) == NULL)
774.           goto err;

crypto/bn/bn_ctx.c:171:1: Parameter `ctx->stack.depth`
  169.   }
  170.   
  171. > void BN_CTX_start(BN_CTX *ctx)
  172.   {
  173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/bn/bn_gf2m.c:773:18: Call
771.       bn_check_top(xx);
772.       BN_CTX_start(ctx);
773.       if ((field = BN_CTX_get(ctx)) == NULL)
                        ^
774.           goto err;
775.       if (!BN_GF2m_arr2poly(p, field))

crypto/bn/bn_ctx.c:202:1: Parameter `ctx->stack.depth`
  200.   }
  201.   
  202. > BIGNUM *BN_CTX_get(BN_CTX *ctx)
  203.   {
  204.       BIGNUM *ret;

crypto/bn/bn_gf2m.c:782:5: Call
780.   
781.    err:
782.       BN_CTX_end(ctx);
           ^
783.       return ret;
784.   }

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

crypto/bn/bn_ctx.c:191:27: Call
  189.           ctx->err_stack--;
  190.       else {
  191.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                   ^
  192.           /* Does this stack frame have anything to release? */
  193.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:266:1: <LHS trace>
264.   }
265.   
266. > static unsigned int BN_STACK_pop(BN_STACK *st)
267.   {
268.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:266:1: Parameter `st->depth`
    264.   }
    265.   
    266. > static unsigned int BN_STACK_pop(BN_STACK *st)
    267.   {
    268.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:268:12: Binary operation: ([0, 5+max(0, ctx->stack.depth)] - 1):unsigned32 by call to `BN_CTX_end` 
    266.   static unsigned int BN_STACK_pop(BN_STACK *st)
    267.   {
    268.       return st->indexes[--(st->depth)];
                      ^
    269.   }
    270.   

static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *xx, const int p[],\n                        BN_CTX *ctx)\n{\n    BIGNUM *field;\n    int ret = 0;\n    bn_check_top(xx);\n    BN_CTX_start(ctx);\n    if ((field = BN_CTX_get(ctx)) == NULL)\n        goto err;\n    if (!BN_GF2m_arr2poly(p, field))\n        goto err;\n    ret = BN_GF2m_mod_inv(r, xx, field, ctx);\n    bn_check_top(r);\n err:\n    BN_CTX_end(ctx);\n    return ret;\n}', 'void BN_CTX_start(BN_CTX *ctx)\n{\n    CTXDBG("ENTER 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("LEAVE BN_CTX_start()", ctx);\n}', 'BIGNUM *BN_CTX_get(BN_CTX *ctx)\n{\n    BIGNUM *ret;\n    CTXDBG("ENTER BN_CTX_get()", ctx);\n    if (ctx->err_stack || ctx->too_many)\n        return NULL;\n    if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) {\n        ctx->too_many = 1;\n        BNerr(BN_F_BN_CTX_GET, BN_R_TOO_MANY_TEMPORARY_VARIABLES);\n        return NULL;\n    }\n    BN_zero(ret);\n    ret->flags &= (~BN_FLG_CONSTTIME);\n    ctx->used++;\n    CTXDBG("LEAVE BN_CTX_get()", ctx);\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 unsigned int BN_STACK_pop(BN_STACK *st)\n{\n    return st->indexes[--(st->depth)];\n}']