crypto/bn/bn_prime.c:256: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_mul`.
Showing all 35 steps of the trace


crypto/bn/bn_prime.c:249:10: Call
247.                      BN_MONT_CTX *mont)
248.   {
249.       if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
                ^
250.           return -1;
251.       if (BN_is_one(w))

crypto/bn/bn_exp.c:296:1: Parameter `a->top`
  294.   }
  295.   
  296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
  297.                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
  298.   {

crypto/bn/bn_prime.c:251:9: Call
249.       if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
250.           return -1;
251.       if (BN_is_one(w))
               ^
252.           return 0;               /* probably prime */
253.       if (BN_cmp(w, a1) == 0)

crypto/bn/bn_lib.c:851:1: Parameter `a->top`
  849.   }
  850.   
  851. > int BN_is_one(const BIGNUM *a)
  852.   {
  853.       return BN_abs_is_word(a, 1) && !a->neg;

crypto/bn/bn_lib.c:853:12: Call
  851.   int BN_is_one(const BIGNUM *a)
  852.   {
  853.       return BN_abs_is_word(a, 1) && !a->neg;
                    ^
  854.   }
  855.   

crypto/bn/bn_lib.c:841:1: Parameter `a->top`
    839.   }
    840.   
    841. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
    842.   {
    843.       return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));

crypto/bn/bn_prime.c:253:9: Call
251.       if (BN_is_one(w))
252.           return 0;               /* probably prime */
253.       if (BN_cmp(w, a1) == 0)
               ^
254.           return 0;               /* w == -1 (mod a), 'a' is probably prime */
255.       while (--k) {

crypto/bn/bn_lib.c:541:1: Parameter `a->top`
  539.   }
  540.   
  541. > int BN_cmp(const BIGNUM *a, const BIGNUM *b)
  542.   {
  543.       int i;

crypto/bn/bn_prime.c:256:14: Call
254.           return 0;               /* w == -1 (mod a), 'a' is probably prime */
255.       while (--k) {
256.           if (!BN_mod_mul(w, w, w, a, ctx)) /* w := w^2 mod a */
                    ^
257.               return -1;
258.           if (BN_is_one(w))

crypto/bn/bn_mod.c:73:1: Parameter `r->top`
  71.   
  72.   /* slow but works */
  73. > int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
  74.                  BN_CTX *ctx)
  75.   {

crypto/bn/bn_mod.c:93:10: Call
  91.               goto err;
  92.       }
  93.       if (!BN_nnmod(r, t, m, ctx))
                 ^
  94.           goto err;
  95.       bn_check_top(r);

crypto/bn/bn_mod.c:13:1: Parameter `r->top`
    11.   #include "bn_lcl.h"
    12.   
    13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
    14.   {
    15.       /*

crypto/bn/bn_mod.c:20:11: Call
    18.        */
    19.   
    20.       if (!(BN_mod(r, m, d, ctx)))
                    ^
    21.           return 0;
    22.       if (!r->neg)

crypto/bn/bn_div.c:137:1: Parameter `rm->top`
      135.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
      136.    */
      137. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
      138.              BN_CTX *ctx)
      139.   {

crypto/bn/bn_div.c:404:9: Call
      402.            */
      403.           int neg = num->neg;
      404.           BN_rshift(rm, snum, norm_shift);
                     ^
      405.           if (!BN_is_zero(rm))
      406.               rm->neg = neg;

crypto/bn/bn_shift.c:122:1: Parameter `r->top`
        120.   }
        121.   
        122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
        123.   {
        124.       int i, j, nw, lb, rb;

crypto/bn/bn_shift.c:140:9: Call
        138.       lb = BN_BITS2 - rb;
        139.       if (nw >= a->top || a->top == 0) {
        140.           BN_zero(r);
                       ^
        141.           return 1;
        142.       }

crypto/bn/bn_lib.c:358:1: Parameter `a->top`
          356.   }
          357.   
          358. > int BN_set_word(BIGNUM *a, BN_ULONG w)
          359.   {
          360.       bn_check_top(a);

crypto/bn/bn_lib.c:361:9: Call
          359.   {
          360.       bn_check_top(a);
          361.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                         ^
          362.           return 0;
          363.       a->neg = 0;

crypto/bn/bn_lcl.h:660:1: Parameter `a->top`
            658.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
            659.   
            660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
            661.   {
            662.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/bn/bn_lcl.h:668:12: Call
            666.           return a;
            667.   
            668.       return bn_expand2((a),(bits+BN_BITS2-1)/BN_BITS2);
                              ^
            669.   }
            670.   

crypto/bn/bn_lib.c:244:1: Parameter `b->top`
              242.    */
              243.   
              244. > BIGNUM *bn_expand2(BIGNUM *b, int words)
              245.   {
              246.       if (words > b->dmax) {

crypto/bn/bn_lib.c:247:23: Call
              245.   {
              246.       if (words > b->dmax) {
              247.           BN_ULONG *a = bn_expand_internal(b, words);
                                           ^
              248.           if (!a)
              249.               return NULL;

crypto/bn/bn_lib.c:208:1: <Offset trace>
206.   /* This is used by bn_expand2() */
207.   /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209.   {
210.       BN_ULONG *a = NULL;

crypto/bn/bn_lib.c:208:1: Parameter `b->top`
                206.   /* This is used by bn_expand2() */
                207.   /* The caller MUST check that words > b->dmax before calling this */
                208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
                209.   {
                210.       BN_ULONG *a = NULL;

crypto/bn/bn_lib.c:208:1: <Length trace>
206.   /* This is used by bn_expand2() */
207.   /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209.   {
210.       BN_ULONG *a = NULL;

crypto/bn/bn_lib.c:208:1: Parameter `words`
                206.   /* This is used by bn_expand2() */
                207.   /* The caller MUST check that words > b->dmax before calling this */
                208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
                209.   {
                210.       BN_ULONG *a = NULL;

crypto/bn/bn_lib.c:223:13: Call
                221.           a = OPENSSL_secure_zalloc(words * sizeof(*a));
                222.       else
                223.           a = OPENSSL_zalloc(words * sizeof(*a));
                                   ^
                224.       if (a == NULL) {
                225.           BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);

crypto/mem.c:228:1: Parameter `num`
                  226.   }
                  227.   
                  228. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
                  229.   {
                  230.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:230:17: Call
                  228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
                  229.   {
                  230.       void *ret = CRYPTO_malloc(num, file, line);
                                         ^
                  231.   
                  232.       FAILTEST();

crypto/mem.c:201:9: Assignment
                    199.   
                    200.       if (num == 0)
                    201.           return NULL;
                                   ^
                    202.   
                    203.       FAILTEST();

crypto/mem.c:230:5: Assignment
                  228.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
                  229.   {
                  230.       void *ret = CRYPTO_malloc(num, file, line);
                             ^
                  231.   
                  232.       FAILTEST();

crypto/mem.c:235:5: Assignment
                  233.       if (ret != NULL)
                  234.           memset(ret, 0, num);
                  235.       return ret;
                             ^
                  236.   }
                  237.   

crypto/bn/bn_lib.c:223:9: Assignment
                221.           a = OPENSSL_secure_zalloc(words * sizeof(*a));
                222.       else
                223.           a = OPENSSL_zalloc(words * sizeof(*a));
                               ^
                224.       if (a == NULL) {
                225.           BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);

crypto/bn/bn_lib.c:231:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_mul` 
                229.       assert(b->top <= words);
                230.       if (b->top > 0)
                231.           memcpy(a, b->d, sizeof(*a) * b->top);
                               ^
                232.   
                233.       return a;
