engines/ccgost/gost2001.c:422: error: INTEGER_OVERFLOW_L2
  ([0, +oo] - 1):unsigned32 by call to `BN_CTX_end`.
Showing all 8 steps of the trace


engines/ccgost/gost2001.c:399:5: Call
397.           goto err;
398.       }
399.       BN_CTX_start(ctx);
           ^
400.       if (!(priv_key = EC_KEY_get0_private_key(ec))) {
401.           GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC, ERR_R_EC_LIB);

crypto/bn/bn_ctx.c:227:1: Parameter `ctx->stack.depth`
  225.   }
  226.   
  227. > void BN_CTX_start(BN_CTX *ctx)
  228.   {
  229.       CTXDBG_ENTRY("BN_CTX_start", ctx);

engines/ccgost/gost2001.c:422:9: Call
420.       if (pub_key) EC_POINT_free(pub_key);
421.       if (ctx) {
422.           BN_CTX_end(ctx);
               ^
423.           BN_CTX_free(ctx);
424.       }

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

crypto/bn/bn_ctx.c:247:27: Call
  245.           ctx->err_stack--;
  246.       else {
  247.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                   ^
  248.           /* Does this stack frame have anything to release? */
  249.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:319:1: <LHS trace>
317.   }
318.   
319. > static unsigned int BN_STACK_pop(BN_STACK *st)
320.   {
321.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:319:1: Parameter `st->depth`
    317.   }
    318.   
    319. > static unsigned int BN_STACK_pop(BN_STACK *st)
    320.   {
    321.       return st->indexes[--(st->depth)];

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

static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['int gost2001_compute_public(EC_KEY *ec)\n{\n    const EC_GROUP *group = EC_KEY_get0_group(ec);\n    EC_POINT *pub_key = NULL;\n    const BIGNUM *priv_key = NULL;\n    BN_CTX *ctx = NULL;\n    int ok = 0;\n    if (!group) {\n        GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC,\n                GOST_R_KEY_IS_NOT_INITIALIZED);\n        return 0;\n    }\n    ctx = BN_CTX_new();\n    if(!ctx) {\n        GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC, ERR_R_MALLOC_FAILURE);\n        goto err;\n    }\n    BN_CTX_start(ctx);\n    if (!(priv_key = EC_KEY_get0_private_key(ec))) {\n        GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC, ERR_R_EC_LIB);\n        goto err;\n    }\n    pub_key = EC_POINT_new(group);\n    if(!pub_key) {\n        GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC, ERR_R_MALLOC_FAILURE);\n        goto err;\n    }\n    if (!EC_POINT_mul(group, pub_key, priv_key, NULL, NULL, ctx)) {\n        GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC, ERR_R_EC_LIB);\n        goto err;\n    }\n    if (!EC_KEY_set_public_key(ec, pub_key)) {\n        GOSTerr(GOST_F_GOST2001_COMPUTE_PUBLIC, ERR_R_EC_LIB);\n        goto err;\n    }\n    ok = 256;\n err:\n    if (pub_key) EC_POINT_free(pub_key);\n    if (ctx) {\n        BN_CTX_end(ctx);\n        BN_CTX_free(ctx);\n    }\n    return ok;\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}', '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}']