crypto/ec/ecp_smpl.c:1308: error: BUFFER_OVERRUN_L3
  Offset: 0 Size: [0, 8388607] by call to `BN_mod_inverse`.
Showing all 23 steps of the trace


crypto/ec/ecp_smpl.c:1259:11: Call
1257.   
1258.       BN_CTX_start(ctx);
1259.       tmp = BN_CTX_get(ctx);
                  ^
1260.       tmp_Z = BN_CTX_get(ctx);
1261.       if (tmp == NULL || tmp_Z == NULL)

crypto/bn/bn_ctx.c:275:5: Call
  273.       }
  274.       /* OK, make sure the returned bignum is "zero" */
  275.       BN_zero(ret);
             ^
  276.       ctx->used++;
  277.       CTXDBG_RET(ctx, ret);

crypto/bn/bn_lib.c:520:1: Parameter `*a->d`
    518.   }
    519.   
    520. > int BN_set_word(BIGNUM *a, BN_ULONG w)
    521.   {
    522.       bn_check_top(a);

crypto/bn/bn_lib.c:523:9: Call
    521.   {
    522.       bn_check_top(a);
    523.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                   ^
    524.           return (0);
    525.       a->neg = 0;

crypto/bn/bn_lcl.h:777:1: Parameter `*a->d`
      775.   int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx);
      776.   
      777. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
      778.   {
      779.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/ec/ecp_smpl.c:1308:10: Call
1306.        */
1307.   
1308.       if (!BN_mod_inverse(tmp, prod_Z[num - 1], group->field, ctx)) {
                 ^
1309.           ECerr(EC_F_EC_GFP_SIMPLE_POINTS_MAKE_AFFINE, ERR_R_BN_LIB);
1310.           goto err;

crypto/bn/bn_gcd.c:225:1: Parameter `*in->d`
  223.                                           BN_CTX *ctx);
  224.   
  225. > BIGNUM *BN_mod_inverse(BIGNUM *in,
  226.                          const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
  227.   {

crypto/bn/bn_gcd.c:230:10: Call
  228.       BIGNUM *rv;
  229.       int noinv;
  230.       rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
                  ^
  231.       if (noinv)
  232.           BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE);

crypto/bn/bn_gcd.c:236:1: Parameter `*in->d`
    234.   }
    235.   
    236. > BIGNUM *int_bn_mod_inverse(BIGNUM *in,
    237.                              const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,
    238.                              int *pnoinv)

crypto/bn/bn_gcd.c:249:16: Call
    247.       if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
    248.           || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
    249.           return BN_mod_inverse_no_branch(in, a, n, ctx);
                          ^
    250.       }
    251.   

crypto/bn/bn_gcd.c:556:1: Parameter `*in->d`
      554.    * not contain branches that may leak sensitive information.
      555.    */
      556. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
      557.                                           const BIGNUM *a, const BIGNUM *n,
      558.                                           BN_CTX *ctx)

crypto/bn/bn_gcd.c:707:18: Call
      705.                   goto err;
      706.           } else {
      707.               if (!BN_nnmod(R, Y, n, ctx))
                              ^
      708.                   goto err;
      709.           }

crypto/bn/bn_mod.c:118:1: Parameter `*r->d`
        116.   #include "bn_lcl.h"
        117.   
        118. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
        119.   {
        120.       /*

crypto/bn/bn_mod.c:125:11: Call
        123.        */
        124.   
        125.       if (!(BN_mod(r, m, d, ctx)))
                         ^
        126.           return 0;
        127.       if (!r->neg)

crypto/bn/bn_div.c:188:1: Parameter `*rm->d`
          186.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
          187.    */
          188. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
          189.              BN_CTX *ctx)
          190.   {

crypto/bn/bn_div.c:453:9: Call
          451.            */
          452.           int neg = num->neg;
          453.           BN_rshift(rm, snum, norm_shift);
                         ^
          454.           if (!BN_is_zero(rm))
          455.               rm->neg = neg;

crypto/bn/bn_shift.c:168:1: Parameter `*r->d`
            166.   }
            167.   
            168. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
            169.   {
            170.       int i, j, nw, lb, rb;

crypto/bn/bn_shift.c:186:9: Call
            184.       lb = BN_BITS2 - rb;
            185.       if (nw >= a->top || a->top == 0) {
            186.           BN_zero(r);
                           ^
            187.           return (1);
            188.       }

crypto/bn/bn_lib.c:520:1: <Length trace>
518.   }
519.   
520. > int BN_set_word(BIGNUM *a, BN_ULONG w)
521.   {
522.       bn_check_top(a);

crypto/bn/bn_lib.c:520:1: Parameter `*a->d`
              518.   }
              519.   
              520. > int BN_set_word(BIGNUM *a, BN_ULONG w)
              521.   {
              522.       bn_check_top(a);

crypto/bn/bn_lib.c:523:9: Call
              521.   {
              522.       bn_check_top(a);
              523.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                             ^
              524.           return (0);
              525.       a->neg = 0;

crypto/bn/bn_lcl.h:777:1: Parameter `*a->d`
                775.   int bn_probable_prime_dh_coprime(BIGNUM *rnd, int bits, BN_CTX *ctx);
                776.   
                777. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
                778.   {
                779.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/bn/bn_lib.c:526:5: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_mod_inverse` 
              524.           return (0);
              525.       a->neg = 0;
              526.       a->d[0] = w;
                         ^
              527.       a->top = (w ? 1 : 0);
              528.       bn_check_top(a);
