crypto/bn/bn_gf2m.c:875: error: BUFFER_OVERRUN_L3
  Offset: [-1, +oo] Size: [1, +oo] by call to `BN_GF2m_mod_sqr_arr`.
Showing all 14 steps of the trace


crypto/bn/bn_gf2m.c:851:1: Parameter `ctx->stack.depth`
849.    * P1363.
850.    */
851. > int BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
852.                           const int p[], BN_CTX *ctx)
853.   {

crypto/bn/bn_gf2m.c:866:5: Call
864.           return (BN_copy(r, a) != NULL);
865.   
866.       BN_CTX_start(ctx);
           ^
867.       if ((u = BN_CTX_get(ctx)) == NULL)
868.           goto err;

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/bn/bn_gf2m.c:875:14: Call
873.       n = BN_num_bits(b) - 1;
874.       for (i = n - 1; i >= 0; i--) {
875.           if (!BN_GF2m_mod_sqr_arr(u, u, p, ctx))
                    ^
876.               goto err;
877.           if (BN_is_bit_set(b, i)) {

crypto/bn/bn_gf2m.c:496:5: Call
  494.   
  495.       bn_check_top(a);
  496.       BN_CTX_start(ctx);
             ^
  497.       if ((s = BN_CTX_get(ctx)) == NULL)
  498.           goto err;

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/bn/bn_gf2m.c:514:5: Call
  512.       ret = 1;
  513.    err:
  514.       BN_CTX_end(ctx);
             ^
  515.       return ret;
  516.   }

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_GF2m_mod_sqr_arr` 
      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 BN_GF2m_mod_exp_arr(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,\n                        const int p[], BN_CTX *ctx)\n{\n    int ret = 0, i, n;\n    BIGNUM *u;\n    bn_check_top(a);\n    bn_check_top(b);\n    if (BN_is_zero(b))\n        return BN_one(r);\n    if (BN_abs_is_word(b, 1))\n        return (BN_copy(r, a) != NULL);\n    BN_CTX_start(ctx);\n    if ((u = BN_CTX_get(ctx)) == NULL)\n        goto err;\n    if (!BN_GF2m_mod_arr(u, a, p))\n        goto err;\n    n = BN_num_bits(b) - 1;\n    for (i = n - 1; i >= 0; i--) {\n        if (!BN_GF2m_mod_sqr_arr(u, u, p, ctx))\n            goto err;\n        if (BN_is_bit_set(b, i)) {\n            if (!BN_GF2m_mod_mul_arr(u, u, a, p, ctx))\n                goto err;\n        }\n    }\n    if (!BN_copy(r, u))\n        goto err;\n    bn_check_top(r);\n    ret = 1;\n err:\n    BN_CTX_end(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}', 'int BN_GF2m_mod_sqr_arr(BIGNUM *r, const BIGNUM *a, const int p[],\n                        BN_CTX *ctx)\n{\n    int i, ret = 0;\n    BIGNUM *s;\n    bn_check_top(a);\n    BN_CTX_start(ctx);\n    if ((s = BN_CTX_get(ctx)) == NULL)\n        goto err;\n    if (!bn_wexpand(s, 2 * a->top))\n        goto err;\n    for (i = a->top - 1; i >= 0; i--) {\n        s->d[2 * i + 1] = SQR1(a->d[i]);\n        s->d[2 * i] = SQR0(a->d[i]);\n    }\n    s->top = 2 * a->top;\n    bn_correct_top(s);\n    if (!BN_GF2m_mod_arr(r, s, p))\n        goto err;\n    bn_check_top(r);\n    ret = 1;\n err:\n    BN_CTX_end(ctx);\n    return ret;\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}']