crypto/bn/bn_gcd.c:155: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_inverse_no_branch`.
Showing all 25 steps of the trace


crypto/bn/bn_gcd.c:135:1: Parameter `n->top`
133.   }
134.   
135. > BIGNUM *int_bn_mod_inverse(BIGNUM *in,
136.                              const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx,
137.                              int *pnoinv)

crypto/bn/bn_gcd.c:144:9: Call
142.   
143.       /* This is invalid input so we don't worry about constant time here */
144.       if (BN_abs_is_word(n, 1) || BN_is_zero(n)) {
               ^
145.           if (pnoinv != NULL)
146.               *pnoinv = 1;

crypto/bn/bn_lib.c:838:1: Parameter `a->top`
  836.   }
  837.   
  838. > int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w)
  839.   {
  840.       return ((a->top == 1) && (a->d[0] == w)) || ((w == 0) && (a->top == 0));

crypto/bn/bn_gcd.c:144:33: Call
142.   
143.       /* This is invalid input so we don't worry about constant time here */
144.       if (BN_abs_is_word(n, 1) || BN_is_zero(n)) {
                                       ^
145.           if (pnoinv != NULL)
146.               *pnoinv = 1;

crypto/bn/bn_lib.c:843:1: Parameter `a->top`
  841.   }
  842.   
  843. > int BN_is_zero(const BIGNUM *a)
  844.   {
  845.       return a->top == 0;

crypto/bn/bn_gcd.c:155:16: Call
153.       if ((BN_get_flags(a, BN_FLG_CONSTTIME) != 0)
154.           || (BN_get_flags(n, BN_FLG_CONSTTIME) != 0)) {
155.           return BN_mod_inverse_no_branch(in, a, n, ctx);
                      ^
156.       }
157.   

crypto/bn/bn_gcd.c:458:1: Parameter `n->top`
  456.    * not contain branches that may leak sensitive information.
  457.    */
  458. > static BIGNUM *BN_mod_inverse_no_branch(BIGNUM *in,
  459.                                           const BIGNUM *a, const BIGNUM *n,
  460.                                           BN_CTX *ctx)

crypto/bn/bn_gcd.c:491:9: Call
  489.       if (BN_copy(B, a) == NULL)
  490.           goto err;
  491.       if (BN_copy(A, n) == NULL)
                 ^
  492.           goto err;
  493.       A->neg = 0;

crypto/bn/bn_lib.c:281:1: Parameter `b->top`
    279.   }
    280.   
    281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
    282.   {
    283.       bn_check_top(b);

crypto/bn/bn_gcd.c:609:18: Call
  607.                   goto err;
  608.           } else {
  609.               if (!BN_nnmod(R, Y, n, ctx))
                          ^
  610.                   goto err;
  611.           }

crypto/bn/bn_mod.c:13:1: Parameter `d->top`
    11.   #include "bn_lcl.h"
    12.   
    13. > int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx)
    14.   {
    15.       /*

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:209:1: Parameter `divisor->top`
      207.    * If 'dv' or 'rm' is NULL, the respective value is not returned.
      208.    */
      209. > int BN_div(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num, const BIGNUM *divisor,
      210.              BN_CTX *ctx)
      211.   {

crypto/bn/bn_div.c:214:9: Call
      212.       int ret;
      213.   
      214.       if (BN_is_zero(divisor)) {
                     ^
      215.           BNerr(BN_F_BN_DIV, BN_R_DIV_BY_ZERO);
      216.           return 0;

crypto/bn/bn_lib.c:843:1: Parameter `a->top`
        841.   }
        842.   
        843. > int BN_is_zero(const BIGNUM *a)
        844.   {
        845.       return a->top == 0;

crypto/bn/bn_div.c:229:11: Call
      227.       }
      228.   
      229.       ret = bn_div_fixed_top(dv, rm, num, divisor, ctx);
                       ^
      230.   
      231.       if (ret) {

crypto/bn/bn_div.c:264:1: Parameter `divisor->top`
        262.    *       divisor's length is considered public;
        263.    */
        264. > int bn_div_fixed_top(BIGNUM *dv, BIGNUM *rm, const BIGNUM *num,
        265.                        const BIGNUM *divisor, BN_CTX *ctx)
        266.   {

crypto/bn/bn_div.c:289:10: Call
        287.   
        288.       /* First we normalise the numbers */
        289.       if (!BN_copy(sdiv, divisor))
                        ^
        290.           goto err;
        291.       norm_shift = bn_left_align(sdiv);

crypto/bn/bn_lib.c:281:1: <Offset trace>
279.   }
280.   
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282.   {
283.       bn_check_top(b);

crypto/bn/bn_lib.c:281:1: Parameter `b->top`
          279.   }
          280.   
          281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
          282.   {
          283.       bn_check_top(b);

crypto/bn/bn_lib.c:281:1: <Length trace>
279.   }
280.   
281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
282.   {
283.       bn_check_top(b);

crypto/bn/bn_lib.c:281:1: Parameter `*a->d`
          279.   }
          280.   
          281. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
          282.   {
          283.       bn_check_top(b);

crypto/bn/bn_lib.c:287:9: Call
          285.       if (a == b)
          286.           return a;
          287.       if (bn_wexpand(a, b->top) == NULL)
                         ^
          288.           return NULL;
          289.   

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:291:9: Array access: Offset added: [8, +oo] Size: [0, 536870848] by call to `BN_mod_inverse_no_branch` 
          289.   
          290.       if (b->top > 0)
          291.           memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
                         ^
          292.   
          293.       a->neg = b->neg;
