crypto/bn/bn_gf2m.c:815: error: BUFFER_OVERRUN_L3
  Offset: 0 Size: [0, 8388607] by call to `BN_GF2m_arr2poly`.
Showing all 9 steps of the trace


crypto/bn/bn_gf2m.c:813:18: Call
811.       bn_check_top(xx);
812.       BN_CTX_start(ctx);
813.       if ((field = BN_CTX_get(ctx)) == NULL)
                        ^
814.           goto err;
815.       if (!BN_GF2m_arr2poly(p, field))

crypto/bn/bn_ctx.c:284:5: Call
  282.       }
  283.       /* OK, make sure the returned bignum is "zero" */
  284.       BN_zero(ret);
             ^
  285.       ctx->used++;
  286.       CTXDBG_RET(ctx, ret);

crypto/bn/bn_lib.c:530:1: Parameter `*a->d`
    528.   }
    529.   
    530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
    531.   {
    532.       bn_check_top(a);

crypto/bn/bn_gf2m.c:815:10: Call
813.       if ((field = BN_CTX_get(ctx)) == NULL)
814.           goto err;
815.       if (!BN_GF2m_arr2poly(p, field))
                ^
816.           goto err;
817.   

crypto/bn/bn_gf2m.c:1280:1: Parameter `*a->d`
  1278.    * bit-string.  The array must be terminated by -1.
  1279.    */
  1280. > int BN_GF2m_arr2poly(const int p[], BIGNUM *a)
  1281.   {
  1282.       int i;

crypto/bn/bn_gf2m.c:1285:5: Call
  1283.   
  1284.       bn_check_top(a);
  1285.       BN_zero(a);
              ^
  1286.       for (i = 0; p[i] != -1; i++) {
  1287.           if (BN_set_bit(a, p[i]) == 0)

crypto/bn/bn_lib.c:530:1: <Length trace>
528.   }
529.   
530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
531.   {
532.       bn_check_top(a);

crypto/bn/bn_lib.c:530:1: Parameter `*a->d`
    528.   }
    529.   
    530. > int BN_set_word(BIGNUM *a, BN_ULONG w)
    531.   {
    532.       bn_check_top(a);

crypto/bn/bn_lib.c:536:5: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_GF2m_arr2poly` 
    534.           return (0);
    535.       a->neg = 0;
    536.       a->d[0] = w;
               ^
    537.       a->top = (w ? 1 : 0);
    538.       bn_check_top(a);

int BN_set_word(BIGNUM *a, BN_ULONG w)
{
    bn_check_top(a);
    if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
        return (0);
    a->neg = 0;
    a->d[0] = w;
    a->top = (w ? 1 : 0);
    bn_check_top(a);
    return (1);
}
['int BN_GF2m_mod_inv_arr(BIGNUM *r, const BIGNUM *xx, const int p[],\n                        BN_CTX *ctx)\n{\n    BIGNUM *field;\n    int ret = 0;\n    bn_check_top(xx);\n    BN_CTX_start(ctx);\n    if ((field = BN_CTX_get(ctx)) == NULL)\n        goto err;\n    if (!BN_GF2m_arr2poly(p, field))\n        goto err;\n    ret = BN_GF2m_mod_inv(r, xx, field, ctx);\n    bn_check_top(r);\n err:\n    BN_CTX_end(ctx);\n    return ret;\n}', 'BIGNUM *BN_CTX_get(BN_CTX *ctx)\n{\n    BIGNUM *ret;\n    CTXDBG_ENTRY("BN_CTX_get", ctx);\n    if (ctx->err_stack || ctx->too_many)\n        return NULL;\n    if ((ret = BN_POOL_get(&ctx->pool, ctx->flags)) == NULL) {\n        ctx->too_many = 1;\n        BNerr(BN_F_BN_CTX_GET, BN_R_TOO_MANY_TEMPORARY_VARIABLES);\n        return NULL;\n    }\n    BN_zero(ret);\n    ctx->used++;\n    CTXDBG_RET(ctx, ret);\n    return ret;\n}', 'int BN_set_word(BIGNUM *a, BN_ULONG w)\n{\n    bn_check_top(a);\n    if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)\n        return (0);\n    a->neg = 0;\n    a->d[0] = w;\n    a->top = (w ? 1 : 0);\n    bn_check_top(a);\n    return (1);\n}', 'int BN_GF2m_arr2poly(const int p[], BIGNUM *a)\n{\n    int i;\n    bn_check_top(a);\n    BN_zero(a);\n    for (i = 0; p[i] != -1; i++) {\n        if (BN_set_bit(a, p[i]) == 0)\n            return 0;\n    }\n    bn_check_top(a);\n    return 1;\n}']