crypto/rsa/rsa_eay.c:120: error: BUFFER_OVERRUN_L3
  Offset: [1, 20] (⇐ 1 + [0, 19]) Size: [0, +oo] by call to `RSA_padding_add_PKCS1_OAEP`.
Showing all 12 steps of the trace


crypto/rsa/rsa_eay.c:106:6: Call
104.   	BN_init(&ret);
105.   	if ((ctx=BN_CTX_new()) == NULL) goto err;
106.   	num=BN_num_bytes(rsa->n);
            ^
107.   	if ((buf=(unsigned char *)Malloc(num)) == NULL)
108.   		{

crypto/bn/bn_lib.c:245:19: Assignment
  243.   	bn_check_top(a);
  244.   
  245.   	if (a->top == 0) return(0);
                           ^
  246.   	l=a->d[a->top-1];
  247.   	i=(a->top-1)*BN_BITS2;

crypto/rsa/rsa_eay.c:106:2: Assignment
104.   	BN_init(&ret);
105.   	if ((ctx=BN_CTX_new()) == NULL) goto err;
106.   	num=BN_num_bytes(rsa->n);
        ^
107.   	if ((buf=(unsigned char *)Malloc(num)) == NULL)
108.   		{

crypto/rsa/rsa_eay.c:107:28: Array declaration
105.   	if ((ctx=BN_CTX_new()) == NULL) goto err;
106.   	num=BN_num_bytes(rsa->n);
107.   	if ((buf=(unsigned char *)Malloc(num)) == NULL)
                                  ^
108.   		{
109.   		RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,ERR_R_MALLOC_FAILURE);

crypto/rsa/rsa_eay.c:107:7: Assignment
105.   	if ((ctx=BN_CTX_new()) == NULL) goto err;
106.   	num=BN_num_bytes(rsa->n);
107.   	if ((buf=(unsigned char *)Malloc(num)) == NULL)
             ^
108.   		{
109.   		RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,ERR_R_MALLOC_FAILURE);

crypto/rsa/rsa_eay.c:120:12: Call
118.   #ifndef NO_SHA
119.   	case RSA_PKCS1_OAEP_PADDING:
120.   	        i=RSA_padding_add_PKCS1_OAEP(buf,num,from,flen,NULL,0);
                  ^
121.   		break;
122.   #endif

crypto/rsa/rsa_oaep.c:65:10: <Offset trace>
63.   
64.       MGF1(seedmask, SHA_DIGEST_LENGTH, db, emlen - SHA_DIGEST_LENGTH);
65.       for (i = 0; i < SHA_DIGEST_LENGTH; i++)
               ^
66.   	seed[i] ^= seedmask[i];
67.   

crypto/rsa/rsa_oaep.c:65:10: Assignment
  63.   
  64.       MGF1(seedmask, SHA_DIGEST_LENGTH, db, emlen - SHA_DIGEST_LENGTH);
  65.       for (i = 0; i < SHA_DIGEST_LENGTH; i++)
                 ^
  66.   	seed[i] ^= seedmask[i];
  67.   

crypto/rsa/rsa_oaep.c:17:1: <Length trace>
15.   int MGF1(unsigned char *mask, long len, unsigned char *seed, long seedlen);
16.   
17. > int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
18.   	     unsigned char *from, int flen, unsigned char *param, int plen)
19.       {

crypto/rsa/rsa_oaep.c:17:1: Parameter `*to`
  15.   int MGF1(unsigned char *mask, long len, unsigned char *seed, long seedlen);
  16.   
  17. > int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
  18.   	     unsigned char *from, int flen, unsigned char *param, int plen)
  19.       {

crypto/rsa/rsa_oaep.c:45:5: Assignment
  43.   
  44.       to[0] = 0;
  45.       seed = to + 1;
            ^
  46.       db = to + SHA_DIGEST_LENGTH + 1;
  47.   

crypto/rsa/rsa_oaep.c:66:2: Array access: Offset: [1, 20] (⇐ 1 + [0, 19]) Size: [0, +oo] by call to `RSA_padding_add_PKCS1_OAEP` 
  64.       MGF1(seedmask, SHA_DIGEST_LENGTH, db, emlen - SHA_DIGEST_LENGTH);
  65.       for (i = 0; i < SHA_DIGEST_LENGTH; i++)
  66.   	seed[i] ^= seedmask[i];
         ^
  67.   
  68.       Free(dbmask);
