crypto/dh/dh_check.c:89: error: BUFFER_OVERRUN_L3
  Offset: 0 Size: [0, 8388607] by call to `BN_mod_exp`.
Showing all 15 steps of the trace


crypto/dh/dh_check.c:77:10: Call
75.           goto err;
76.       BN_CTX_start(ctx);
77.       t1 = BN_CTX_get(ctx);
               ^
78.       t2 = BN_CTX_get(ctx);
79.       if (t2 == NULL)

crypto/bn/bn_ctx.c:229:5: Call
  227.       }
  228.       /* OK, make sure the returned bignum is "zero" */
  229.       BN_zero(ret);
             ^
  230.       ctx->used++;
  231.       CTXDBG_RET(ctx, ret);

crypto/bn/bn_lib.c:395:1: Parameter `*a->d`
    393.   }
    394.   
    395. > int BN_set_word(BIGNUM *a, BN_ULONG w)
    396.   {
    397.       bn_check_top(a);

crypto/bn/bn_lib.c:398:9: Call
    396.   {
    397.       bn_check_top(a);
    398.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                   ^
    399.           return (0);
    400.       a->neg = 0;

crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
      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/dh/dh_check.c:89:18: Call
87.           else {
88.               /* Check g^q == 1 mod p */
89.               if (!BN_mod_exp(t1, dh->g, dh->q, dh->p, ctx))
                       ^
90.                   goto err;
91.               if (!BN_is_one(t1))

crypto/bn/bn_exp.c:88:1: Parameter `*r->d`
  86.   }
  87.   
  88. > int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m,
  89.                  BN_CTX *ctx)
  90.   {

crypto/bn/bn_exp.c:138:19: Call
  136.               && (BN_get_flags(p, BN_FLG_CONSTTIME) == 0)) {
  137.               BN_ULONG A = a->d[0];
  138.               ret = BN_mod_exp_mont_word(r, A, p, m, ctx, NULL);
                           ^
  139.           } else
  140.   # endif

crypto/bn/bn_exp.c:1088:1: Parameter `*rr->d`
    1086.   }
    1087.   
    1088. > int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p,
    1089.                            const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
    1090.   {

crypto/bn/bn_exp.c:1135:13: Call
    1133.           if (BN_is_one(m)) {
    1134.               ret = 1;
    1135.               BN_zero(rr);
                        ^
    1136.           } else {
    1137.               ret = BN_one(rr);

crypto/bn/bn_lib.c:395:1: <Length trace>
393.   }
394.   
395. > int BN_set_word(BIGNUM *a, BN_ULONG w)
396.   {
397.       bn_check_top(a);

crypto/bn/bn_lib.c:395:1: Parameter `*a->d`
      393.   }
      394.   
      395. > int BN_set_word(BIGNUM *a, BN_ULONG w)
      396.   {
      397.       bn_check_top(a);

crypto/bn/bn_lib.c:398:9: Call
      396.   {
      397.       bn_check_top(a);
      398.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                     ^
      399.           return (0);
      400.       a->neg = 0;

crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
        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_lib.c:401:5: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_mod_exp` 
      399.           return (0);
      400.       a->neg = 0;
      401.       a->d[0] = w;
                 ^
      402.       a->top = (w ? 1 : 0);
      403.       bn_check_top(a);
