crypto/bn/bn_recp.c:131: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_rshift`.
Showing all 23 steps of the trace


crypto/bn/bn_recp.c:90:29: Call
88.   
89.       BN_CTX_start(ctx);
90.       d = (dv != NULL) ? dv : BN_CTX_get(ctx);
                                  ^
91.       r = (rem != NULL) ? rem : BN_CTX_get(ctx);
92.       a = BN_CTX_get(ctx);

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:394:15: Assignment
    392.       a->neg = 0;
    393.       a->d[0] = w;
    394.       a->top = (w ? 1 : 0);
                         ^
    395.       bn_check_top(a);
    396.       return 1;

crypto/bn/bn_lib.c:394:5: Assignment
    392.       a->neg = 0;
    393.       a->d[0] = w;
    394.       a->top = (w ? 1 : 0);
               ^
    395.       bn_check_top(a);
    396.       return 1;

crypto/bn/bn_recp.c:131:10: Call
129.        *    = |m/N|
130.        */
131.       if (!BN_rshift(a, m, recp->num_bits))
                ^
132.           goto err;
133.       if (!BN_mul(b, a, &(recp->Nr), ctx))

crypto/bn/bn_shift.c:122:1: Parameter `r->top`
  120.   }
  121.   
  122. > int BN_rshift(BIGNUM *r, const BIGNUM *a, int n)
  123.   {
  124.       int i, j, nw, lb, rb;

crypto/bn/bn_shift.c:145:13: Call
  143.       i = (BN_num_bits(a) - n + (BN_BITS2 - 1)) / BN_BITS2;
  144.       if (r != a) {
  145.           if (bn_wexpand(r, i) == NULL)
                     ^
  146.               return 0;
  147.           r->neg = a->neg;

crypto/bn/bn_lib.c:940:1: Parameter `a->top`
    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->top`
      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 `words`
        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:252:13: Call
        250.           a = OPENSSL_secure_zalloc(words * sizeof(*a));
        251.       else
        252.           a = OPENSSL_zalloc(words * sizeof(*a));
                           ^
        253.       if (a == NULL) {
        254.           BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);

crypto/mem.c:218:1: Parameter `num`
          216.   }
          217.   
          218. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
          219.   {
          220.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:220:17: Call
          218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
          219.   {
          220.       void *ret = CRYPTO_malloc(num, file, line);
                                 ^
          221.   
          222.       FAILTEST();

crypto/mem.c:198:9: Assignment
            196.   
            197.       if (num == 0)
            198.           return NULL;
                           ^
            199.   
            200.       FAILTEST();

crypto/mem.c:220:5: Assignment
          218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
          219.   {
          220.       void *ret = CRYPTO_malloc(num, file, line);
                     ^
          221.   
          222.       FAILTEST();

crypto/mem.c:225:5: Assignment
          223.       if (ret != NULL)
          224.           memset(ret, 0, num);
          225.       return ret;
                     ^
          226.   }
          227.   

crypto/bn/bn_lib.c:252:9: Assignment
        250.           a = OPENSSL_secure_zalloc(words * sizeof(*a));
        251.       else
        252.           a = OPENSSL_zalloc(words * sizeof(*a));
                       ^
        253.       if (a == NULL) {
        254.           BNerr(BN_F_BN_EXPAND_INTERNAL, ERR_R_MALLOC_FAILURE);

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