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


crypto/ec/ec2_smpl.c:374:5: Call
372.       }
373.   
374.       BN_CTX_start(ctx);
           ^
375.       x0 = BN_CTX_get(ctx);
376.       y0 = BN_CTX_get(ctx);

crypto/bn/bn_ctx.c:171:1: Parameter `*ctx->stack.indexes`
  169.   }
  170.   
  171. > void BN_CTX_start(BN_CTX *ctx)
  172.   {
  173.       CTXDBG("ENTER BN_CTX_start()", ctx);

crypto/ec/ec2_smpl.c:455:5: Call
453.   
454.    err:
455.       BN_CTX_end(ctx);
           ^
456.       BN_CTX_free(new_ctx);
457.       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.       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: <Offset 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:268:1: <Length 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->indexes`
    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: Array access: Offset: [-1, +oo] Size: [1, +oo] 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_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,\n                       const EC_POINT *b, BN_CTX *ctx)\n{\n    BN_CTX *new_ctx = NULL;\n    BIGNUM *x0, *y0, *x1, *y1, *x2, *y2, *s, *t;\n    int ret = 0;\n    if (EC_POINT_is_at_infinity(group, a)) {\n        if (!EC_POINT_copy(r, b))\n            return 0;\n        return 1;\n    }\n    if (EC_POINT_is_at_infinity(group, b)) {\n        if (!EC_POINT_copy(r, a))\n            return 0;\n        return 1;\n    }\n    if (ctx == NULL) {\n        ctx = new_ctx = BN_CTX_new();\n        if (ctx == NULL)\n            return 0;\n    }\n    BN_CTX_start(ctx);\n    x0 = BN_CTX_get(ctx);\n    y0 = BN_CTX_get(ctx);\n    x1 = BN_CTX_get(ctx);\n    y1 = BN_CTX_get(ctx);\n    x2 = BN_CTX_get(ctx);\n    y2 = BN_CTX_get(ctx);\n    s = BN_CTX_get(ctx);\n    t = BN_CTX_get(ctx);\n    if (t == NULL)\n        goto err;\n    if (a->Z_is_one) {\n        if (!BN_copy(x0, a->X))\n            goto err;\n        if (!BN_copy(y0, a->Y))\n            goto err;\n    } else {\n        if (!EC_POINT_get_affine_coordinates(group, a, x0, y0, ctx))\n            goto err;\n    }\n    if (b->Z_is_one) {\n        if (!BN_copy(x1, b->X))\n            goto err;\n        if (!BN_copy(y1, b->Y))\n            goto err;\n    } else {\n        if (!EC_POINT_get_affine_coordinates(group, b, x1, y1, ctx))\n            goto err;\n    }\n    if (BN_GF2m_cmp(x0, x1)) {\n        if (!BN_GF2m_add(t, x0, x1))\n            goto err;\n        if (!BN_GF2m_add(s, y0, y1))\n            goto err;\n        if (!group->meth->field_div(group, s, s, t, ctx))\n            goto err;\n        if (!group->meth->field_sqr(group, x2, s, ctx))\n            goto err;\n        if (!BN_GF2m_add(x2, x2, group->a))\n            goto err;\n        if (!BN_GF2m_add(x2, x2, s))\n            goto err;\n        if (!BN_GF2m_add(x2, x2, t))\n            goto err;\n    } else {\n        if (BN_GF2m_cmp(y0, y1) || BN_is_zero(x1)) {\n            if (!EC_POINT_set_to_infinity(group, r))\n                goto err;\n            ret = 1;\n            goto err;\n        }\n        if (!group->meth->field_div(group, s, y1, x1, ctx))\n            goto err;\n        if (!BN_GF2m_add(s, s, x1))\n            goto err;\n        if (!group->meth->field_sqr(group, x2, s, ctx))\n            goto err;\n        if (!BN_GF2m_add(x2, x2, s))\n            goto err;\n        if (!BN_GF2m_add(x2, x2, group->a))\n            goto err;\n    }\n    if (!BN_GF2m_add(y2, x1, x2))\n        goto err;\n    if (!group->meth->field_mul(group, y2, y2, s, ctx))\n        goto err;\n    if (!BN_GF2m_add(y2, y2, x2))\n        goto err;\n    if (!BN_GF2m_add(y2, y2, y1))\n        goto err;\n    if (!EC_POINT_set_affine_coordinates(group, r, x2, y2, 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}']