crypto/pem/pem_seal.c:86: error: INTEGER_OVERFLOW_L2
  ([0, `(*pubk)->pkey.rsa->n->top`] - 1):unsigned64 by call to `RSA_size`.
Showing all 7 steps of the trace


crypto/pem/pem_seal.c:70:1: Parameter `(*pubk)->pkey.rsa->n->top`
68.   #include <openssl/rsa.h>
69.   
70. > int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type,
71.   	     unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk,
72.   	     int npubk)

crypto/pem/pem_seal.c:86:5: Call
84.   			goto err;
85.   			}
86.   		j=RSA_size(pubk[i]->pkey.rsa);
          ^
87.   		if (j > max) max=j;
88.   		}

crypto/rsa/rsa_lib.c:274:1: Parameter `r->n->top`
  272.   	}
  273.   
  274. > int RSA_size(const RSA *r)
  275.   	{
  276.   	return(BN_num_bytes(r->n));

crypto/rsa/rsa_lib.c:276:9: Call
  274.   int RSA_size(const RSA *r)
  275.   	{
  276.   	return(BN_num_bytes(r->n));
                 ^
  277.   	}
  278.   

crypto/bn/bn_lib.c:248:1: <LHS trace>
246.   	}
247.   
248. > int BN_num_bits(const BIGNUM *a)
249.   	{
250.   	int i = a->top - 1;

crypto/bn/bn_lib.c:248:1: Parameter `a->top`
    246.   	}
    247.   
    248. > int BN_num_bits(const BIGNUM *a)
    249.   	{
    250.   	int i = a->top - 1;

crypto/bn/bn_lib.c:250:2: Binary operation: ([0, (*pubk)->pkey.rsa->n->top] - 1):unsigned64 by call to `RSA_size` 
    248.   int BN_num_bits(const BIGNUM *a)
    249.   	{
    250.   	int i = a->top - 1;
            ^
    251.   	bn_check_top(a);
    252.   

int BN_num_bits(const BIGNUM *a)
	{
	int i = a->top - 1;
	bn_check_top(a);
	if (BN_is_zero(a)) return 0;
	return ((i*BN_BITS2) + BN_num_bits_word(a->d[i]));
	}
['int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type,\n\t     unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk,\n\t     int npubk)\n\t{\n\tunsigned char key[EVP_MAX_KEY_LENGTH];\n\tint ret= -1;\n\tint i,j,max=0;\n\tchar *s=NULL;\n\tfor (i=0; i<npubk; i++)\n\t\t{\n\t\tif (pubk[i]->type != EVP_PKEY_RSA)\n\t\t\t{\n\t\t\tPEMerr(PEM_F_PEM_SEALINIT,PEM_R_PUBLIC_KEY_NO_RSA);\n\t\t\tgoto err;\n\t\t\t}\n\t\tj=RSA_size(pubk[i]->pkey.rsa);\n\t\tif (j > max) max=j;\n\t\t}\n\ts=(char *)OPENSSL_malloc(max*2);\n\tif (s == NULL)\n\t\t{\n\t\tPEMerr(PEM_F_PEM_SEALINIT,ERR_R_MALLOC_FAILURE);\n\t\tgoto err;\n\t\t}\n\tEVP_EncodeInit(&ctx->encode);\n\tEVP_MD_CTX_init(&ctx->md);\n\tEVP_SignInit(&ctx->md,md_type);\n\tEVP_CIPHER_CTX_init(&ctx->cipher);\n\tret=EVP_SealInit(&ctx->cipher,type,ek,ekl,iv,pubk,npubk);\n\tif (!ret) goto err;\n\tfor (i=0; i<npubk; i++)\n\t\t{\n\t\tj=EVP_EncodeBlock((unsigned char *)s,ek[i],\n\t\t\tRSA_size(pubk[i]->pkey.rsa));\n\t\tekl[i]=j;\n\t\tmemcpy(ek[i],s,j+1);\n\t\t}\n\tret=npubk;\nerr:\n\tif (s != NULL) OPENSSL_free(s);\n\tOPENSSL_cleanse(key,EVP_MAX_KEY_LENGTH);\n\treturn(ret);\n\t}', 'int RSA_size(const RSA *r)\n\t{\n\treturn(BN_num_bytes(r->n));\n\t}', 'int BN_num_bits(const BIGNUM *a)\n\t{\n\tint i = a->top - 1;\n\tbn_check_top(a);\n\tif (BN_is_zero(a)) return 0;\n\treturn ((i*BN_BITS2) + BN_num_bits_word(a->d[i]));\n\t}']