crypto/rsa/rsa_ossl.c:561: error: BUFFER_OVERRUN_L3
  Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_MONT_CTX_set_locked`.
Showing all 24 steps of the trace


crypto/rsa/rsa_ossl.c:503:1: Parameter `rsa->n->top`
501.   
502.   /* signature verification */
503. > static int rsa_ossl_public_decrypt(int flen, const unsigned char *from,
504.                                     unsigned char *to, RSA *rsa, int padding)
505.   {

crypto/rsa/rsa_ossl.c:512:9: Call
510.       BN_CTX *ctx = NULL;
511.   
512.       if (BN_num_bits(rsa->n) > OPENSSL_RSA_MAX_MODULUS_BITS) {
               ^
513.           RSAerr(RSA_F_RSA_OSSL_PUBLIC_DECRYPT, RSA_R_MODULUS_TOO_LARGE);
514.           return -1;

crypto/bn/bn_lib.c:166:9: Call
  164.       bn_check_top(a);
  165.   
  166.       if (BN_is_zero(a))
                 ^
  167.           return 0;
  168.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:852:1: Parameter `a->top`
    850.   }
    851.   
    852. > int BN_is_zero(const BIGNUM *a)
    853.   {
    854.       return a->top == 0;

crypto/rsa/rsa_ossl.c:523:9: Call
521.   
522.       /* for large moduli, enforce exponent limit */
523.       if (BN_num_bits(rsa->n) > OPENSSL_RSA_SMALL_MODULUS_BITS) {
               ^
524.           if (BN_num_bits(rsa->e) > OPENSSL_RSA_MAX_PUBEXP_BITS) {
525.               RSAerr(RSA_F_RSA_OSSL_PUBLIC_DECRYPT, RSA_R_BAD_E_VALUE);

crypto/bn/bn_lib.c:166:9: Call
  164.       bn_check_top(a);
  165.   
  166.       if (BN_is_zero(a))
                 ^
  167.           return 0;
  168.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:852:1: Parameter `a->top`
    850.   }
    851.   
    852. > int BN_is_zero(const BIGNUM *a)
    853.   {
    854.       return a->top == 0;

crypto/rsa/rsa_ossl.c:535:11: Call
533.       f = BN_CTX_get(ctx);
534.       ret = BN_CTX_get(ctx);
535.       num = BN_num_bytes(rsa->n);
                 ^
536.       buf = OPENSSL_malloc(num);
537.       if (ret == NULL || buf == NULL) {

crypto/bn/bn_lib.c:166:9: Call
  164.       bn_check_top(a);
  165.   
  166.       if (BN_is_zero(a))
                 ^
  167.           return 0;
  168.       return ((i * BN_BITS2) + BN_num_bits_word(a->d[i]));

crypto/bn/bn_lib.c:852:1: Parameter `a->top`
    850.   }
    851.   
    852. > int BN_is_zero(const BIGNUM *a)
    853.   {
    854.       return a->top == 0;

crypto/rsa/rsa_ossl.c:561:14: Call
559.   
560.       if (rsa->flags & RSA_FLAG_CACHE_PUBLIC)
561.           if (!BN_MONT_CTX_set_locked
                    ^
562.               (&rsa->_method_mod_n, rsa->lock, rsa->n, ctx))
563.               goto err;

crypto/bn/bn_mont.c:398:1: Parameter `mod->top`
  396.   }
  397.   
  398. > BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_RWLOCK *lock,
  399.                                       const BIGNUM *mod, BN_CTX *ctx)
  400.   {

crypto/bn/bn_mont.c:420:10: Call
  418.       if (ret == NULL)
  419.           return NULL;
  420.       if (!BN_MONT_CTX_set(ret, mod, ctx)) {
                  ^
  421.           BN_MONT_CTX_free(ret);
  422.           return NULL;

crypto/bn/bn_mont.c:247:1: Parameter `mod->top`
    245.   }
    246.   
    247. > int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
    248.   {
    249.       int ret = 0;

crypto/bn/bn_mont.c:252:9: Call
    250.       BIGNUM *Ri, *R;
    251.   
    252.       if (BN_is_zero(mod))
                   ^
    253.           return 0;
    254.   

crypto/bn/bn_lib.c:852:1: Parameter `a->top`
      850.   }
      851.   
      852. > int BN_is_zero(const BIGNUM *a)
      853.   {
      854.       return a->top == 0;

crypto/bn/bn_mont.c:259:10: Call
    257.           goto err;
    258.       R = &(mont->RR);            /* grab RR as a temp */
    259.       if (!BN_copy(&(mont->N), mod))
                    ^
    260.           goto err;               /* Set N */
    261.       mont->N.neg = 0;

crypto/bn/bn_lib.c:323:1: <Offset trace>
321.   }
322.   
323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
324.   {
325.       bn_check_top(b);

crypto/bn/bn_lib.c:323:1: Parameter `b->top`
      321.   }
      322.   
      323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
      324.   {
      325.       bn_check_top(b);

crypto/bn/bn_lib.c:323:1: <Length trace>
321.   }
322.   
323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
324.   {
325.       bn_check_top(b);

crypto/bn/bn_lib.c:323:1: Parameter `*a->d`
      321.   }
      322.   
      323. > BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b)
      324.   {
      325.       bn_check_top(b);

crypto/bn/bn_lib.c:329:9: Call
      327.       if (a == b)
      328.           return a;
      329.       if (bn_wexpand(a, b->top) == NULL)
                     ^
      330.           return NULL;
      331.   

crypto/bn/bn_lib.c:948:1: Parameter `*a->d`
        946.   }
        947.   
        948. > BIGNUM *bn_wexpand(BIGNUM *a, int words)
        949.   {
        950.       return (words <= a->dmax) ? a : bn_expand2(a, words);

crypto/bn/bn_lib.c:333:9: Array access: Offset added: [8, +oo] Size: [0, 67108856] by call to `BN_MONT_CTX_set_locked` 
      331.   
      332.       if (b->top > 0)
      333.           memcpy(a->d, b->d, sizeof(b->d[0]) * b->top);
                     ^
      334.   
      335.       a->top = b->top;
