crypto/dsa/dsa_ossl.c:268: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 536870848] by call to `dsa_mod_inverse_fermat`.
Showing all 18 steps of the trace


crypto/dsa/dsa_ossl.c:207:10: Call
205.       q_bits = BN_num_bits(dsa->q);
206.       q_words = bn_get_top(dsa->q);
207.       if (!bn_wexpand(k, q_words + 2)
                ^
208.           || !bn_wexpand(l, q_words + 2))
209.           goto err;

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

crypto/dsa/dsa_ossl.c:268:17: Call
266.   
267.       /* Compute part of 's = inv(k) (m + xr) mod q' */
268.       if ((kinv = dsa_mod_inverse_fermat(k, dsa->q, ctx)) == NULL)
                       ^
269.           goto err;
270.   

crypto/dsa/dsa_ossl.c:409:1: Parameter `k->top`
  407.    * BIGNUM is returned which the caller must free.
  408.    */
  409. > static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q,
  410.                                         BN_CTX *ctx)
  411.   {

crypto/dsa/dsa_ossl.c:422:16: Call
  420.               && BN_set_word(r, 2)
  421.               && BN_sub(e, q, r)
  422.               && BN_mod_exp_mont(r, k, e, q, ctx, NULL))
                        ^
  423.           res = r;
  424.       else

crypto/bn/bn_exp.c:296:1: Parameter `a->top`
    294.   }
    295.   
    296. > int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
    297.                       const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont)
    298.   {

crypto/bn/bn_exp.c:354:14: Call
    352.   
    353.       if (a->neg || BN_ucmp(a, m) >= 0) {
    354.           if (!BN_nnmod(val[0], a, m, ctx))
                        ^
    355.               goto err;
    356.           aa = val[0];

crypto/bn/bn_mod.c:13:1: Parameter `*r->d`
      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: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:233:17: Call
        231.       if (!no_branch && BN_ucmp(num, divisor) < 0) {
        232.           if (rm != NULL) {
        233.               if (BN_copy(rm, num) == NULL)
                               ^
        234.                   return 0;
        235.           }

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 `dsa_mod_inverse_fermat` 
          289.   
          290.       if (b->top > 0)
          291.           memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
                         ^
          292.   
          293.       a->neg = b->neg;
