crypto/bn/bn_blind.c:108: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_BLINDING_create_param`.
Showing all 12 steps of the trace


crypto/bn/bn_blind.c:108:14: Call
106.           !(b->flags & BN_BLINDING_NO_RECREATE)) {
107.           /* re-create blinding parameters */
108.           if (!BN_BLINDING_create_param(b, NULL, NULL, ctx, NULL, NULL))
                    ^
109.               goto err;
110.       } else if (!(b->flags & BN_BLINDING_NO_UPDATE)) {

crypto/bn/bn_blind.c:213:1: Parameter `e->top`
  211.   }
  212.   
  213. > BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
  214.                                         const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
  215.                                         int (*bn_mod_exp) (BIGNUM *r,

crypto/bn/bn_blind.c:241:18: Call
  239.       if (e != NULL) {
  240.           BN_free(ret->e);
  241.           ret->e = BN_dup(e);
                          ^
  242.       }
  243.       if (ret->e == NULL)

crypto/bn/bn_lib.c:261:1: Parameter `a->top`
    259.   }
    260.   
    261. > BIGNUM *BN_dup(const BIGNUM *a)
    262.   {
    263.       BIGNUM *t;

crypto/bn/bn_lib.c:272:10: Call
    270.       if (t == NULL)
    271.           return NULL;
    272.       if (!BN_copy(t, a)) {
                    ^
    273.           BN_free(t);
    274.           return NULL;

crypto/bn/bn_lib.c:280:1: <Offset trace>
278.   }
279.   
280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
281.   {
282.       bn_check_top(b);

crypto/bn/bn_lib.c:280:1: Parameter `b->top`
      278.   }
      279.   
      280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
      281.   {
      282.       bn_check_top(b);

crypto/bn/bn_lib.c:280:1: <Length trace>
278.   }
279.   
280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
281.   {
282.       bn_check_top(b);

crypto/bn/bn_lib.c:280:1: Parameter `*a->d`
      278.   }
      279.   
      280. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
      281.   {
      282.       bn_check_top(b);

crypto/bn/bn_lib.c:286:9: Call
      284.       if (a == b)
      285.           return a;
      286.       if (bn_wexpand(a, b->top) == NULL)
                     ^
      287.           return NULL;
      288.   

crypto/bn/bn_lib.c:942:1: Parameter `*a->d`
        940.   }
        941.   
        942. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
        943.   {
        944.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_lib.c:290:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_BLINDING_create_param` 
      288.   
      289.       if (b->top > 0)
      290.           memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
                     ^
      291.   
      292.       a->neg = b->neg;

BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
{
    bn_check_top(b);
    if (a == b)
        return a;
    if (bn_wexpand(a, b->top) == NULL)
        return NULL;
    if (b->top > 0)
        memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
    a->neg = b->neg;
    a->top = b->top;
    a->flags |= b->flags & BN_FLG_FIXED_TOP;
    bn_check_top(a);
    return a;
}
['int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx)\n{\n    int ret = 0;\n    if ((b->A == NULL) || (b->Ai == NULL)) {\n        BNerr(BN_F_BN_BLINDING_UPDATE, BN_R_NOT_INITIALIZED);\n        goto err;\n    }\n    if (b->counter == -1)\n        b->counter = 0;\n    if (++b->counter == BN_BLINDING_COUNTER && b->e != NULL &&\n        !(b->flags & BN_BLINDING_NO_RECREATE)) {\n        if (!BN_BLINDING_create_param(b, NULL, NULL, ctx, NULL, NULL))\n            goto err;\n    } else if (!(b->flags & BN_BLINDING_NO_UPDATE)) {\n        if (!BN_mod_mul(b->A, b->A, b->A, b->mod, ctx))\n            goto err;\n        if (!BN_mod_mul(b->Ai, b->Ai, b->Ai, b->mod, ctx))\n            goto err;\n    }\n    ret = 1;\n err:\n    if (b->counter == BN_BLINDING_COUNTER)\n        b->counter = 0;\n    return ret;\n}', 'BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,\n                                      const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,\n                                      int (*bn_mod_exp) (BIGNUM *r,\n                                                         const BIGNUM *a,\n                                                         const BIGNUM *p,\n                                                         const BIGNUM *m,\n                                                         BN_CTX *ctx,\n                                                         BN_MONT_CTX *m_ctx),\n                                      BN_MONT_CTX *m_ctx)\n{\n    int retry_counter = 32;\n    BN_BLINDING *ret = NULL;\n    if (b == NULL)\n        ret = BN_BLINDING_new(NULL, NULL, m);\n    else\n        ret = b;\n    if (ret == NULL)\n        goto err;\n    if (ret->A == NULL && (ret->A = BN_new()) == NULL)\n        goto err;\n    if (ret->Ai == NULL && (ret->Ai = BN_new()) == NULL)\n        goto err;\n    if (e != NULL) {\n        BN_free(ret->e);\n        ret->e = BN_dup(e);\n    }\n    if (ret->e == NULL)\n        goto err;\n    if (bn_mod_exp != NULL)\n        ret->bn_mod_exp = bn_mod_exp;\n    if (m_ctx != NULL)\n        ret->m_ctx = m_ctx;\n    do {\n        int rv;\n        if (!BN_priv_rand_range(ret->A, ret->mod))\n            goto err;\n        if (!int_bn_mod_inverse(ret->Ai, ret->A, ret->mod, ctx, &rv)) {\n            if (rv) {\n                if (retry_counter-- == 0) {\n                    BNerr(BN_F_BN_BLINDING_CREATE_PARAM,\n                          BN_R_TOO_MANY_ITERATIONS);\n                    goto err;\n                }\n            } else\n                goto err;\n        } else\n            break;\n    } while (1);\n    if (ret->bn_mod_exp != NULL && ret->m_ctx != NULL) {\n        if (!ret->bn_mod_exp\n            (ret->A, ret->A, ret->e, ret->mod, ctx, ret->m_ctx))\n            goto err;\n    } else {\n        if (!BN_mod_exp(ret->A, ret->A, ret->e, ret->mod, ctx))\n            goto err;\n    }\n    return ret;\n err:\n    if (b == NULL) {\n        BN_BLINDING_free(ret);\n        ret = NULL;\n    }\n    return ret;\n}', 'BIGNUM *BN_dup(const BIGNUM *a)\n{\n    BIGNUM *t;\n    if (a == NULL)\n        return NULL;\n    bn_check_top(a);\n    t = BN_get_flags(a, BN_FLG_SECURE) ? BN_secure_new() : BN_new();\n    if (t == NULL)\n        return NULL;\n    if (!BN_copy(t, a)) {\n        BN_free(t);\n        return NULL;\n    }\n    bn_check_top(t);\n    return t;\n}', 'BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)\n{\n    bn_check_top(b);\n    if (a == b)\n        return a;\n    if (bn_wexpand(a, b->top) == NULL)\n        return NULL;\n    if (b->top > 0)\n        memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);\n    a->neg = b->neg;\n    a->top = b->top;\n    a->flags |= b->flags & BN_FLG_FIXED_TOP;\n    bn_check_top(a);\n    return a;\n}', 'BIGNUM *bn_wexpand(BIGNUM *a, int words)\n{\n    return (words <= a->dmax) ? a : bn_expand2(a, words);\n}']