crypto/bn/bn_exp.c:359: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 536870848] by call to `bn_to_mont_fixed_top`.
Showing all 17 steps of the trace


crypto/bn/bn_exp.c:349:14: Call
347.           if ((mont = BN_MONT_CTX_new()) == NULL)
348.               goto err;
349.           if (!BN_MONT_CTX_set(mont, m, ctx))
                    ^
350.               goto err;
351.       }

crypto/bn/bn_mont.c:353:14: Call
  351.           else if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
  352.               goto err;
  353.           if (!BN_lshift(Ri, Ri, BN_BITS2))
                      ^
  354.               goto err;           /* R*Ri */
  355.           if (!BN_is_zero(Ri)) {

crypto/bn/bn_shift.c:84:1: Parameter `r->top`
    82.   }
    83.   
    84. > int BN_lshift(BIGNUM *r, const BIGNUM *a, int n)
    85.   {
    86.       int ret;

crypto/bn/bn_exp.c:359:10: Call
357.       } else
358.           aa = a;
359.       if (!bn_to_mont_fixed_top(val[0], aa, mont, ctx))
                ^
360.           goto err;               /* 1 */
361.   

crypto/bn/bn_mont.c:222:1: Parameter `*r->d`
  220.   }
  221.   
  222. > int bn_to_mont_fixed_top(BIGNUM *r, const BIGNUM *a, BN_MONT_CTX *mont,
  223.                            BN_CTX *ctx)
  224.   {

crypto/bn/bn_mont.c:225:12: Call
  223.                            BN_CTX *ctx)
  224.   {
  225.       return bn_mul_mont_fixed_top(r, a, &(mont->RR), mont, ctx);
                    ^
  226.   }
  227.   

crypto/bn/bn_mont.c:37:1: Parameter `*r->d`
    35.   }
    36.   
    37. > int bn_mul_mont_fixed_top(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
    38.                             BN_MONT_CTX *mont, BN_CTX *ctx)
    39.   {

crypto/bn/bn_mont.c:46:13: Call
    44.   #if defined(OPENSSL_BN_ASM_MONT) && defined(MONT_WORD)
    45.       if (num > 1 && a->top == num && b->top == num) {
    46.           if (bn_wexpand(r, num) == NULL)
                      ^
    47.               return 0;
    48.           if (bn_mul_mont(r->d, a->d, b->d, mont->N.d, mont->n0, num)) {

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

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

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

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

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

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

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

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

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