test/bntest.c:288: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, +oo] by call to `BN_div_recp`.
Showing all 18 steps of the trace


test/bntest.c:287:9: Call
285.           BN_set_negative(a, rand_neg());
286.           BN_set_negative(b, rand_neg());
287.           BN_RECP_CTX_set(recp, b, ctx);
               ^
288.           BN_div_recp(d, c, a, recp, ctx);
289.           BN_mul(e, d, b, ctx);

crypto/bn/bn_recp.c:45:1: Parameter `*recp->Nr.d`
  43.   }
  44.   
  45. > int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *d, BN_CTX *ctx)
  46.   {
  47.       if (!BN_copy(&(recp->N), d))

test/bntest.c:288:9: Call
286.           BN_set_negative(b, rand_neg());
287.           BN_RECP_CTX_set(recp, b, ctx);
288.           BN_div_recp(d, c, a, recp, ctx);
               ^
289.           BN_mul(e, d, b, ctx);
290.           BN_add(d, e, c);

crypto/bn/bn_recp.c:84:1: Parameter `*recp->Nr.d`
  82.   }
  83.   
  84. > int BN_div_recp(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m,
  85.                   BN_RECP_CTX *recp, BN_CTX *ctx)
  86.   {

crypto/bn/bn_recp.c:121:23: Call
  119.       /* Nr := round(2^i / N) */
  120.       if (i != recp->shift)
  121.           recp->shift = BN_reciprocal(&(recp->Nr), &(recp->N), i, ctx);
                               ^
  122.       /* BN_reciprocal could have returned -1 for an error */
  123.       if (recp->shift == -1)

crypto/bn/bn_recp.c:174:1: Parameter `*r->d`
    172.    */
    173.   /* r := 2^len / m */
    174. > int BN_reciprocal(BIGNUM *r, const BIGNUM *m, int len, BN_CTX *ctx)
    175.   {
    176.       int ret = -1;

crypto/bn/bn_recp.c:186:10: Call
    184.           goto err;
    185.   
    186.       if (!BN_div(r, NULL, t, m, ctx))
                    ^
    187.           goto err;
    188.   

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:252:10: Call
      250.   
      251.       /* Setup to 'res' */
      252.       if (!bn_wexpand(res, (loop + 1)))
                      ^
      253.           goto err;
      254.       res->neg = (num->neg ^ divisor->neg);

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

crypto/bn/bn_lib.c:944:37: Call
        942.   BIGNUM *bn_wexpand(BIGNUM *a, int words)
        943.   {
        944.       return (words <= a->dmax) ? a : bn_expand2(a, words);
                                                   ^
        945.   }
        946.   

crypto/bn/bn_lib.c:244:1: Parameter `*b->d`
          242.    */
          243.   
          244. > BIGNUM *bn_expand2(BIGNUM *b, int words)
          245.   {
          246.       if (words > b->dmax) {

crypto/bn/bn_lib.c:247:23: Call
          245.   {
          246.       if (words > b->dmax) {
          247.           BN_ULONG *a = bn_expand_internal(b, words);
                                       ^
          248.           if (!a)
          249.               return NULL;

crypto/bn/bn_lib.c:208:1: <Offset trace>
206.   /* This is used by bn_expand2() */
207.   /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209.   {
210.       BN_ULONG *a = NULL;

crypto/bn/bn_lib.c:208:1: Parameter `b->top`
            206.   /* This is used by bn_expand2() */
            207.   /* The caller MUST check that words > b->dmax before calling this */
            208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
            209.   {
            210.       BN_ULONG *a = NULL;

crypto/bn/bn_lib.c:208:1: <Length trace>
206.   /* This is used by bn_expand2() */
207.   /* The caller MUST check that words > b->dmax before calling this */
208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
209.   {
210.       BN_ULONG *a = NULL;

crypto/bn/bn_lib.c:208:1: Parameter `*b->d`
            206.   /* This is used by bn_expand2() */
            207.   /* The caller MUST check that words > b->dmax before calling this */
            208. > static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words)
            209.   {
            210.       BN_ULONG *a = NULL;

crypto/bn/bn_lib.c:231:9: Array access: Offset added: [8, +oo] Size: [0, +oo] by call to `BN_div_recp` 
            229.       assert(b->top <= words);
            230.       if (b->top > 0)
            231.           memcpy(a, b->d, sizeof(*a) * b->top);
                           ^
            232.   
            233.       return a;
