crypto/bn/bn_gf2m.c:1001: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_sqr_arr`.
Showing all 13 steps of the trace


crypto/bn/bn_gf2m.c:977:1: Parameter `ctx->stack.depth`
975.    * P1363.
976.    */
977. > int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
978.                           const int p[], BN_CTX *ctx)
979.   {

crypto/bn/bn_gf2m.c:992:5: Call
990.           return (BN_copy(r, a) != NULL);
991.   
992.       BN_CTX_start(ctx);
           ^
993.       if ((u = BN_CTX_get(ctx)) == NULL)
994.           goto err;

crypto/bn/bn_ctx.c:240:1: Parameter `ctx->stack.depth`
  238.   }
  239.   
  240. > void BN_CTX_start(BN_CTX *ctx)
  241.   {
  242.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_gf2m.c:1001:14: Call
999.       n = BN_num_bits(b) - 1;
1000.       for (i = n - 1; i >= 0; i--) {
1001.           if (!BN_GF2m_mod_sqr_arr(u, u, p, ctx))
                     ^
1002.               goto err;
1003.           if (BN_is_bit_set(b, i)) {

crypto/bn/bn_gf2m.c:568:1: Parameter `ctx->stack.depth`
  566.   
  567.   /* Square a, reduce the result mod p, and store it in a.  r could be a. */
  568. > int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],
  569.                           BN_CTX *ctx)
  570.   {

crypto/bn/bn_gf2m.c:575:5: Call
  573.   
  574.       bn_check_top(a);
  575.       BN_CTX_start(ctx);
             ^
  576.       if ((s = BN_CTX_get(ctx)) == NULL)
  577.           return 0;

crypto/bn/bn_ctx.c:240:1: Parameter `ctx->stack.depth`
    238.   }
    239.   
    240. > void BN_CTX_start(BN_CTX *ctx)
    241.   {
    242.       CTXDBG_ENTRY("BN_CTX_start", ctx);

crypto/bn/bn_gf2m.c:593:5: Call
  591.       ret = 1;
  592.    err:
  593.       BN_CTX_end(ctx);
             ^
  594.       return ret;
  595.   }

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

crypto/bn/bn_ctx.c:260:27: Call
    258.           ctx->err_stack--;
    259.       else {
    260.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                     ^
    261.           /* Does this stack frame have anything to release? */
    262.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:330:1: <LHS trace>
328.   }
329.   
330. > static unsigned int BN_STACK_pop(BN_STACK *st)
331.   {
332.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:330:1: Parameter `st->depth`
      328.   }
      329.   
      330. > static unsigned int BN_STACK_pop(BN_STACK *st)
      331.   {
      332.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:332:12: Binary operation: ([0, +oo] - 1):unsigned32 by call to `BN_GF2m_mod_sqr_arr` 
      330.   static unsigned int BN_STACK_pop(BN_STACK *st)
      331.   {
      332.       return st->indexes[--(st->depth)];
                        ^
      333.   }
      334.   

static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n                        const int p[], BN_CTX *ctx)\n{\n    int ret = 0, i, n;\n    BIGNUM *u;\n    bn_check_top(a);\n    bn_check_top(b);\n    if (BN_is_zero(b))\n        return (BN_one(r));\n    if (BN_abs_is_word(b, 1))\n        return (BN_copy(r, a) != NULL);\n    BN_CTX_start(ctx);\n    if ((u = BN_CTX_get(ctx)) == NULL)\n        goto err;\n    if (!BN_GF2m_mod_arr(u, a, p))\n        goto err;\n    n = BN_num_bits(b) - 1;\n    for (i = n - 1; i >= 0; i--) {\n        if (!BN_GF2m_mod_sqr_arr(u, u, p, ctx))\n            goto err;\n        if (BN_is_bit_set(b, i)) {\n            if (!BN_GF2m_mod_mul_arr(u, u, a, p, ctx))\n                goto err;\n        }\n    }\n    if (!BN_copy(r, u))\n        goto err;\n    bn_check_top(r);\n    ret = 1;\n err:\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}', 'int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],\n                        BN_CTX *ctx)\n{\n    int i, ret = 0;\n    BIGNUM *s;\n    bn_check_top(a);\n    BN_CTX_start(ctx);\n    if ((s = BN_CTX_get(ctx)) == NULL)\n        return 0;\n    if (!bn_wexpand(s, 2 * a->top))\n        goto err;\n    for (i = a->top - 1; i >= 0; i--) {\n        s->d[2 * i + 1] = SQR1(a->d[i]);\n        s->d[2 * i] = SQR0(a->d[i]);\n    }\n    s->top = 2 * a->top;\n    bn_correct_top(s);\n    if (!BN_GF2m_mod_arr(r, s, p))\n        goto err;\n    bn_check_top(r);\n    ret = 1;\n err:\n    BN_CTX_end(ctx);\n    return ret;\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}']