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


crypto/ec/ec2_oct.c:33:1: Parameter `ctx->stack.depth`
31.    * (and additionally fail to cite the EUROCRYPT '92 publication as prior art).
32.    */
33. > int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group,
34.                                                 EC_POINT *point,
35.                                                 const BIGNUM *x_, int y_bit,

crypto/ec/ec2_oct.c:53:5: Call
51.       y_bit = (y_bit != 0) ? 1 : 0;
52.   
53.       BN_CTX_start(ctx);
          ^
54.       tmp = BN_CTX_get(ctx);
55.       x = BN_CTX_get(ctx);

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/ec/ec2_oct.c:103:5: Call
101.   
102.    err:
103.       BN_CTX_end(ctx);
           ^
104.       BN_CTX_free(new_ctx);
105.       return ret;

crypto/bn/bn_ctx.c:185:1: Parameter `ctx->stack.depth`
  183.   }
  184.   
  185. > void BN_CTX_end(BN_CTX *ctx)
  186.   {
  187.       if (ctx == NULL)

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

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

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

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

static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['int ec_GF2m_simple_set_compressed_coordinates(const EC_GROUP *group,\n                                              EC_POINT *point,\n                                              const BIGNUM *x_, int y_bit,\n                                              BN_CTX *ctx)\n{\n    BN_CTX *new_ctx = NULL;\n    BIGNUM *tmp, *x, *y, *z;\n    int ret = 0, z0;\n    ERR_clear_error();\n    if (ctx == NULL) {\n        ctx = new_ctx = BN_CTX_new();\n        if (ctx == NULL)\n            return 0;\n    }\n    y_bit = (y_bit != 0) ? 1 : 0;\n    BN_CTX_start(ctx);\n    tmp = BN_CTX_get(ctx);\n    x = BN_CTX_get(ctx);\n    y = BN_CTX_get(ctx);\n    z = BN_CTX_get(ctx);\n    if (z == NULL)\n        goto err;\n    if (!BN_GF2m_mod_arr(x, x_, group->poly))\n        goto err;\n    if (BN_is_zero(x)) {\n        if (!BN_GF2m_mod_sqrt_arr(y, group->b, group->poly, ctx))\n            goto err;\n    } else {\n        if (!group->meth->field_sqr(group, tmp, x, ctx))\n            goto err;\n        if (!group->meth->field_div(group, tmp, group->b, tmp, ctx))\n            goto err;\n        if (!BN_GF2m_add(tmp, group->a, tmp))\n            goto err;\n        if (!BN_GF2m_add(tmp, x, tmp))\n            goto err;\n        if (!BN_GF2m_mod_solve_quad_arr(z, tmp, group->poly, ctx)) {\n            unsigned long err = ERR_peek_last_error();\n            if (ERR_GET_LIB(err) == ERR_LIB_BN\n                && ERR_GET_REASON(err) == BN_R_NO_SOLUTION) {\n                ERR_clear_error();\n                ECerr(EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES,\n                      EC_R_INVALID_COMPRESSED_POINT);\n            } else\n                ECerr(EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES,\n                      ERR_R_BN_LIB);\n            goto err;\n        }\n        z0 = (BN_is_odd(z)) ? 1 : 0;\n        if (!group->meth->field_mul(group, y, x, z, ctx))\n            goto err;\n        if (z0 != y_bit) {\n            if (!BN_GF2m_add(y, y, x))\n                goto err;\n        }\n    }\n    if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx))\n        goto err;\n    ret = 1;\n err:\n    BN_CTX_end(ctx);\n    BN_CTX_free(new_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}', 'void BN_CTX_end(BN_CTX *ctx)\n{\n    if (ctx == NULL)\n        return;\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}']