crypto/rsa/rsa_x931g.c:158: error: BUFFER_OVERRUN_L3
  Offset: 0 Size: [0, 8388607] by call to `BN_X931_generate_Xpq`.
Showing all 17 steps of the trace


crypto/rsa/rsa_x931g.c:154:10: Call
152.   
153.       BN_CTX_start(ctx);
154.       Xp = BN_CTX_get(ctx);
                ^
155.       Xq = BN_CTX_get(ctx);
156.       if (Xq == NULL)

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:395:1: Parameter `*a->d`
    393.   }
    394.   
    395. > int BN_set_word(BIGNUM *a, BN_ULONG w)
    396.   {
    397.       bn_check_top(a);

crypto/bn/bn_lib.c:398:9: Call
    396.   {
    397.       bn_check_top(a);
    398.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                   ^
    399.           return (0);
    400.       a->neg = 0;

crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
      658.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
      659.   
      660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
      661.   {
      662.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/rsa/rsa_x931g.c:158:10: Call
156.       if (Xq == NULL)
157.           goto error;
158.       if (!BN_X931_generate_Xpq(Xp, Xq, bits, ctx))
                ^
159.           goto error;
160.   

crypto/bn/bn_x931p.c:160:1: Parameter `*Xp->d`
  158.    */
  159.   
  160. > int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx)
  161.   {
  162.       BIGNUM *t;

crypto/bn/bn_x931p.c:176:10: Call
  174.        * exceeded.
  175.        */
  176.       if (!BN_rand(Xp, nbits, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ANY))
                  ^
  177.           goto err;
  178.   

crypto/bn/bn_rand.c:96:1: Parameter `*rnd->d`
    94.   }
    95.   
    96. > int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
    97.   {
    98.       return bnrand(0, rnd, bits, top, bottom);

crypto/bn/bn_rand.c:98:12: Call
    96.   int BN_rand(BIGNUM *rnd, int bits, int top, int bottom)
    97.   {
    98.       return bnrand(0, rnd, bits, top, bottom);
                      ^
    99.   }
    100.   

crypto/bn/bn_rand.c:17:1: Parameter `*rnd->d`
      15.   #include <openssl/sha.h>
      16.   
      17. > static int bnrand(int testing, BIGNUM *rnd, int bits, int top, int bottom)
      18.   {
      19.       unsigned char *buf = NULL;

crypto/bn/bn_rand.c:26:9: Call
      24.           if (top != BN_RAND_TOP_ANY || bottom != BN_RAND_BOTTOM_ANY)
      25.               goto toosmall;
      26.           BN_zero(rnd);
                    ^
      27.           return 1;
      28.       }

crypto/bn/bn_lib.c:395:1: <Length trace>
393.   }
394.   
395. > int BN_set_word(BIGNUM *a, BN_ULONG w)
396.   {
397.       bn_check_top(a);

crypto/bn/bn_lib.c:395:1: Parameter `*a->d`
        393.   }
        394.   
        395. > int BN_set_word(BIGNUM *a, BN_ULONG w)
        396.   {
        397.       bn_check_top(a);

crypto/bn/bn_lib.c:398:9: Call
        396.   {
        397.       bn_check_top(a);
        398.       if (bn_expand(a, (int)sizeof(BN_ULONG) * 8) == NULL)
                       ^
        399.           return (0);
        400.       a->neg = 0;

crypto/bn/bn_lcl.h:660:1: Parameter `*a->d`
          658.                            const BIGNUM *add, const BIGNUM *rem, BN_CTX *ctx);
          659.   
          660. > static ossl_inline BIGNUM *bn_expand(BIGNUM *a, int bits)
          661.   {
          662.       if (bits > (INT_MAX - BN_BITS2 + 1))

crypto/bn/bn_lib.c:401:5: Array access: Offset: 0 Size: [0, 8388607] by call to `BN_X931_generate_Xpq` 
        399.           return (0);
        400.       a->neg = 0;
        401.       a->d[0] = w;
                   ^
        402.       a->top = (w ? 1 : 0);
        403.       bn_check_top(a);
