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


engines/ccgost/gost_ameth.c:440:9: Call
438.               return 0;
439.           }
440.           BN_CTX_start(ctx);
               ^
441.           X = BN_CTX_get(ctx);
442.           Y = BN_CTX_get(ctx);

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

engines/ccgost/gost_ameth.c:463:9: Call
461.           BN_print(out, Y);
462.           BIO_printf(out, "\n");
463.           BN_CTX_end(ctx);
               ^
464.           BN_CTX_free(ctx);
465.       }

crypto/bn/bn_ctx.c:267:1: Parameter `ctx->stack.depth`
  265.   }
  266.   
  267. > void BN_CTX_end(BN_CTX *ctx)
  268.   {
  269.       CTXDBG_ENTRY("BN_CTX_end", ctx);

crypto/bn/bn_ctx.c:273:27: Call
  271.           ctx->err_stack--;
  272.       else {
  273.           unsigned int fp = BN_STACK_pop(&ctx->stack);
                                   ^
  274.           /* Does this stack frame have anything to release? */
  275.           if (fp < ctx->used)

crypto/bn/bn_ctx.c:351:1: <LHS trace>
349.   }
350.   
351. > static unsigned int BN_STACK_pop(BN_STACK *st)
352.   {
353.       return st->indexes[--(st->depth)];

crypto/bn/bn_ctx.c:351:1: Parameter `st->depth`
    349.   }
    350.   
    351. > static unsigned int BN_STACK_pop(BN_STACK *st)
    352.   {
    353.       return st->indexes[--(st->depth)];

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

static unsigned int BN_STACK_pop(BN_STACK *st)
{
    return st->indexes[--(st->depth)];
}
['static int print_gost_01(BIO *out, const EVP_PKEY *pkey, int indent,\n                         ASN1_PCTX *pctx, int type)\n{\n    int param_nid = NID_undef;\n    if (type == 2) {\n        BIGNUM *key;\n        if (!BIO_indent(out, indent, 128))\n            return 0;\n        BIO_printf(out, "Private key: ");\n        key = gost_get0_priv_key(pkey);\n        if (!key)\n            BIO_printf(out, "<undefined)");\n        else\n            BN_print(out, key);\n        BIO_printf(out, "\\n");\n    }\n    if (type >= 1) {\n        BN_CTX *ctx = BN_CTX_new();\n        BIGNUM *X, *Y;\n        const EC_POINT *pubkey;\n        const EC_GROUP *group;\n        if (!ctx) {\n            GOSTerr(GOST_F_PRINT_GOST_01, ERR_R_MALLOC_FAILURE);\n            return 0;\n        }\n        BN_CTX_start(ctx);\n        X = BN_CTX_get(ctx);\n        Y = BN_CTX_get(ctx);\n        pubkey =\n            EC_KEY_get0_public_key((EC_KEY *)EVP_PKEY_get0((EVP_PKEY *)pkey));\n        group = EC_KEY_get0_group((EC_KEY *)EVP_PKEY_get0((EVP_PKEY *)pkey));\n        if (!EC_POINT_get_affine_coordinates_GFp(group, pubkey, X, Y, ctx)) {\n            GOSTerr(GOST_F_PRINT_GOST_01, ERR_R_EC_LIB);\n            BN_CTX_free(ctx);\n            return 0;\n        }\n        if (!BIO_indent(out, indent, 128))\n            return 0;\n        BIO_printf(out, "Public key:\\n");\n        if (!BIO_indent(out, indent + 3, 128))\n            return 0;\n        BIO_printf(out, "X:");\n        BN_print(out, X);\n        BIO_printf(out, "\\n");\n        BIO_indent(out, indent + 3, 128);\n        BIO_printf(out, "Y:");\n        BN_print(out, Y);\n        BIO_printf(out, "\\n");\n        BN_CTX_end(ctx);\n        BN_CTX_free(ctx);\n    }\n    param_nid =\n        EC_GROUP_get_curve_name(EC_KEY_get0_group\n                                (EVP_PKEY_get0((EVP_PKEY *)pkey)));\n    if (!BIO_indent(out, indent, 128))\n        return 0;\n    BIO_printf(out, "Parameter set: %s\\n", OBJ_nid2ln(param_nid));\n    return 1;\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}']