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


crypto/bn/bn_prime.c:251:10: Call
249.                      BN_MONT_CTX *mont)
250.   {
251.       if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
                ^
252.           return -1;
253.       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:253:9: Call
251.       if (!BN_mod_exp_mont(w, w, a1_odd, a, ctx, mont)) /* w := w^a1_odd mod a */
252.           return -1;
253.       if (BN_is_one(w))
               ^
254.           return 0;               /* probably prime */
255.       if (BN_cmp(w, a1) == 0)

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

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

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

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

crypto/bn/bn_lib.c:569:1: Parameter `a->top`
  567.   }
  568.   
  569. > int BN_cmp(const BIGNUM *a, const BIGNUM *b)
  570.   {
  571.       int i;

crypto/bn/bn_prime.c:258:14: Call
256.           return 0;               /* w == -1 (mod a), 'a' is probably prime */
257.       while (--k) {
258.           if (!BN_mod_mul(w, w, w, a, ctx)) /* w := w^2 mod a */
                    ^
259.               return -1;
260.           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:182:17: Call
      180.       if (!no_branch && BN_ucmp(num, divisor) < 0) {
      181.           if (rm != NULL) {
      182.               if (BN_copy(rm, num) == NULL)
                             ^
      183.                   return 0;
      184.           }

crypto/bn/bn_lib.c:312:1: Parameter `a->top`
        310.   }
        311.   
        312. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
        313.   {
        314.       bn_check_top(b);

crypto/bn/bn_lib.c:318:9: Call
        316.       if (a == b)
        317.           return a;
        318.       if (bn_wexpand(a, b->top) == NULL)
                       ^
        319.           return NULL;
        320.   

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

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

crypto/bn/bn_lib.c:273:1: Parameter `b->top`
            271.    */
            272.   
            273. > BIGNUM *bn_expand2(BIGNUM *b, int words)
            274.   {
            275.       bn_check_top(b);

crypto/bn/bn_lib.c:278:23: Call
            276.   
            277.       if (words > b->dmax) {
            278.           BN_ULONG *a = bn_expand_internal(b, words);
                                         ^
            279.           if (!a)
            280.               return NULL;

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

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

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

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

crypto/bn/bn_lib.c:252:13: Call
              250.           a = OPENSSL_secure_zalloc(words * sizeof(*a));
              251.       else
              252.           a = OPENSSL_zalloc(words * sizeof(*a));
                                 ^
              253.       if (a == NULL) {
              254.           BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);

crypto/mem.c:218:1: Parameter `num`
                216.   }
                217.   
                218. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
                219.   {
                220.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:220:17: Call
                218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
                219.   {
                220.       void *ret = CRYPTO_malloc(num, file, line);
                                       ^
                221.   
                222.       FAILTEST();

crypto/mem.c:198:9: Assignment
                  196.   
                  197.       if (num == 0)
                  198.           return NULL;
                                 ^
                  199.   
                  200.       FAILTEST();

crypto/mem.c:220:5: Assignment
                218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
                219.   {
                220.       void *ret = CRYPTO_malloc(num, file, line);
                           ^
                221.   
                222.       FAILTEST();

crypto/mem.c:225:5: Assignment
                223.       if (ret != NULL)
                224.           memset(ret, 0, num);
                225.       return ret;
                           ^
                226.   }
                227.   

crypto/bn/bn_lib.c:252:9: Assignment
              250.           a = OPENSSL_secure_zalloc(words * sizeof(*a));
              251.       else
              252.           a = OPENSSL_zalloc(words * sizeof(*a));
                             ^
              253.       if (a == NULL) {
              254.           BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);

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