crypto/ec/ec2_smpl.c:208: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `BN_CTX_end`.
Showing all 9 steps of the trace


crypto/ec/ec2_smpl.c:174:1: Parameter `ctx->stack.depth`
172.    * elliptic curve <=> b != 0 (mod p)
173.    */
174. > int ec_GF2m_simple_group_check_discriminant(const EC_GROUP *group,
175.                                               BN_CTX *ctx)
176.   {

crypto/ec/ec2_smpl.c:208:9: Call
206.    err:
207.       if (ctx != NULL)
208.           BN_CTX_end(ctx);
               ^
209.       BN_CTX_free(new_ctx);
210.       return ret;

crypto/bn/bn_ctx.c:185:1: Parameter `*ctx->stack.indexes`
  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: <Offset 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:266:1: <Length 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->indexes`
    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: Array access: Offset: [-1, +oo] Size: [1, +oo] 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 ec_GF2m_simple_group_check_discriminant(const EC_GROUP *group,\n                                            BN_CTX *ctx)\n{\n    int ret = 0;\n    BIGNUM *b;\n    BN_CTX *new_ctx = NULL;\n    if (ctx == NULL) {\n        ctx = new_ctx = BN_CTX_new();\n        if (ctx == NULL) {\n            ECerr(EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT,\n                  ERR_R_MALLOC_FAILURE);\n            goto err;\n        }\n    }\n    BN_CTX_start(ctx);\n    b = BN_CTX_get(ctx);\n    if (b == NULL)\n        goto err;\n    if (!BN_GF2m_mod_arr(b, group->b, group->poly))\n        goto err;\n    if (BN_is_zero(b))\n        goto err;\n    ret = 1;\n err:\n    if (ctx != NULL)\n        BN_CTX_end(ctx);\n    BN_CTX_free(new_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}']