crypto/bn/bn_exp2.c:72: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, +oo] by call to `BN_div`.
Showing all 24 steps of the trace


crypto/bn/bn_exp2.c:61:14: Call
59.           if ((mont = BN_MONT_CTX_new()) == NULL)
60.               goto err;
61.           if (!BN_MONT_CTX_set(mont, m, ctx))
                   ^
62.               goto err;
63.       }

crypto/bn/bn_mont.c:256:15: Call
  254.   
  255.       BN_CTX_start(ctx);
  256.       if ((Ri = BN_CTX_get(ctx)) == NULL)
                       ^
  257.           goto err;
  258.       R = &(mont->RR);            /* grab RR as a temp */

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:387:1: Parameter `*a->d`
      385.   }
      386.   
      387. > int BN_set_word(BIGNUM *a, BN_ULONG w)
      388.   {
      389.       bn_check_top(a);

crypto/bn/bn_lib.c:390:9: Call
      388.   {
      389.       bn_check_top(a);
      390.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                     ^
      391.           return 0;
      392.       a->neg = 0;

crypto/bn/bn_lcl.h:651:1: Parameter `*a->d`
        649.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
        650.   
        651. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
        652.   {
        653.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/bn/bn_mont.c:329:14: Call
  327.           tmod.top = buf[0] != 0 ? 1 : 0;
  328.           /* Ri = R^-1 mod N */
  329.           if ((BN_mod_inverse(Ri, R, &tmod, ctx)) == NULL)
                      ^
  330.               goto err;
  331.           if (!BN_lshift(Ri, Ri, BN_BITS2))

crypto/bn/bn_gcd.c:124:1: Parameter `*in->d`
    122.                                           BN_CTX *ctx);
    123.   
    124. > BIGNUM *BN_mod_inverse(BIGNUM *in,
    125.                          const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx)
    126.   {

crypto/bn/bn_gcd.c:129:10: Call
    127.       BIGNUM *rv;
    128.       int noinv;
    129.       rv = int_bn_mod_inverse(in, a, n, ctx, &noinv);
                    ^
    130.       if (noinv)
    131.           BNerr(BN_F_BN_MOD_INVERSE, BN_R_NO_INVERSE);

crypto/bn/bn_gcd.c:180:14: Call
      178.       A->neg = 0;
      179.       if (B->neg || (BN_ucmp(B, A) >= 0)) {
      180.           if (!BN_nnmod(B, B, A, ctx))
                          ^
      181.               goto err;
      182.       }

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 `*dv->d`
          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_exp2.c:72:14: Call
70.        */
71.       if (a1->neg || BN_ucmp(a1, m) >= 0) {
72.           if (!BN_mod(val1[0], a1, m, ctx))
                   ^
73.               goto err;
74.           a_mod_m = val1[0];

crypto/bn/bn_div.c:137:1: Parameter `*dv->d`
  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:251:10: Call
  249.   
  250.       /* Setup to 'res' */
  251.       if (!bn_wexpand(res, (loop + 1)))
                  ^
  252.           goto err;
  253.       res->neg = (num->neg ^ divisor->neg);

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