crypto/bn/bn_exp.c:1053: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_mod_mul_montgomery`.
Showing all 25 steps of the trace


crypto/bn/bn_exp.c:741:14: Assignment
739.           /* 2^(top*BN_BITS2) - m */
740.           tmp.d[0] = (0 - m->d[0]) & BN_MASK2;
741.           for (i = 1; i < top; i++)
                    ^
742.               tmp.d[i] = (~m->d[i]) & BN_MASK2;
743.           tmp.top = top;

crypto/bn/bn_exp.c:1040:14: Call
1038.           for (wvalue = 0, i = bits % window; i >= 0; i--, bits--)
1039.               wvalue = (wvalue << 1) + BN_is_bit_set(p, bits);
1040.           if (!MOD_EXP_CTIME_COPY_FROM_PREBUF(&tmp, top, powerbuf, wvalue,
                     ^
1041.                                               window))
1042.               goto err;

crypto/bn/bn_exp.c:522:1: Parameter `top`
  520.   }
  521.   
  522. > static int MOD_EXP_CTIME_COPY_FROM_PREBUF(BIGNUM *b, int top,
  523.                                             unsigned char *buf, int idx,
  524.                                             int window)

crypto/bn/bn_exp.c:579:5: Assignment
  577.       }
  578.   
  579.       b->top = top;
             ^
  580.       bn_correct_top(b);
  581.       return 1;

crypto/bn/bn_exp.c:580:5: Call
  578.   
  579.       b->top = top;
  580.       bn_correct_top(b);
             ^
  581.       return 1;
  582.   }

crypto/bn/bn_lib.c:945:1: Parameter `a->top`
    943.   }
    944.   
    945. > void bn_correct_top(BIGNUM *a)
    946.   {
    947.       BN_ULONG *ftl;

crypto/bn/bn_exp.c:1053:22: Call
1051.               /* Scan the window, squaring the result as we go */
1052.               for (i = 0; i < window; i++, bits--) {
1053.                   if (!BN_mod_mul_montgomery(&tmp, &tmp, &tmp, mont, ctx))
                             ^
1054.                       goto err;
1055.                   wvalue = (wvalue << 1) + BN_is_bit_set(p, bits);

crypto/bn/bn_mont.c:26:1: Parameter `r->top`
  24.   #endif
  25.   
  26. > int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
  27.                             BN_MONT_CTX *mont, BN_CTX *ctx)
  28.   {

crypto/bn/bn_mont.c:35:13: Call
  33.   
  34.       if (num > 1 && a->top == num && b->top == num) {
  35.           if (bn_wexpand(r, num) == NULL)
                    ^
  36.               return 0;
  37.           if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) {

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_montgomery` 
        258.       assert(b->top <= words);
        259.       if (b->top > 0)
        260.           memcpy(a, b->d, sizeof(*a) * b->top);
                       ^
        261.   
        262.       return a;
