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


crypto/bn/bn_gcd.c:155:9: Call
153.   
154.       BN_CTX_start(ctx);
155.       A = BN_CTX_get(ctx);
               ^
156.       B = BN_CTX_get(ctx);
157.       X = 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:357:1: Parameter `*a->d`
    355.   }
    356.   
    357. > int BN_set_word(BIGNUM *a, BN_ULONG w)
    358.   {
    359.       bn_check_top(a);

crypto/bn/bn_lib.c:360:9: Call
    358.   {
    359.       bn_check_top(a);
    360.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                   ^
    361.           return 0;
    362.       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_gcd.c:339:22: Call
337.                   }
338.               } else {
339.                   if (!BN_div(D, M, A, B, ctx))
                            ^
340.                       goto err;
341.               }

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:910:1: Parameter `*a->d`
    908.   }
    909.   
    910. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
    911.   {
    912.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_lib.c:912:37: Call
    910.   BIGNUM *bn_wexpand(BIGNUM *a, int words)
    911.   {
    912.       return (words <= a->dmax) ? a : bn_expand2(a, words);
                                               ^
    913.   }
    914.   

crypto/bn/bn_lib.c:246:1: Parameter `*b->d`
      244.    */
      245.   
      246. > BIGNUM *bn_expand2(BIGNUM *b, int words)
      247.   {
      248.       bn_check_top(b);

crypto/bn/bn_lib.c:251:23: Call
      249.   
      250.       if (words > b->dmax) {
      251.           BN_ULONG *a = bn_expand_internal(b, words);
                                   ^
      252.           if (!a)
      253.               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:233:9: Array access: Offset added: [8, +oo] Size: [0, +oo] by call to `BN_div` 
        231.       assert(b->top <= words);
        232.       if (b->top > 0)
        233.           memcpy(a, b->d, sizeof(*a) * b->top);
                       ^
        234.   
        235.       return a;
