crypto/rsa/rsa_eay.c:130: 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:117:6: Call
115.   	BN_init(&ret);
116.   	if ((ctx=BN_CTX_new()) == NULL) goto err;
117.   	num=BN_num_bytes(rsa->n);
            ^
118.   	if ((buf=(unsigned char *)Malloc(num)) == NULL)
119.   		{

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:117:2: Assignment
115.   	BN_init(&ret);
116.   	if ((ctx=BN_CTX_new()) == NULL) goto err;
117.   	num=BN_num_bytes(rsa->n);
        ^
118.   	if ((buf=(unsigned char *)Malloc(num)) == NULL)
119.   		{

crypto/rsa/rsa_eay.c:118:28: Array declaration
116.   	if ((ctx=BN_CTX_new()) == NULL) goto err;
117.   	num=BN_num_bytes(rsa->n);
118.   	if ((buf=(unsigned char *)Malloc(num)) == NULL)
                                  ^
119.   		{
120.   		RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,ERR_R_MALLOC_FAILURE);

crypto/rsa/rsa_eay.c:118:7: Assignment
116.   	if ((ctx=BN_CTX_new()) == NULL) goto err;
117.   	num=BN_num_bytes(rsa->n);
118.   	if ((buf=(unsigned char *)Malloc(num)) == NULL)
             ^
119.   		{
120.   		RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT,ERR_R_MALLOC_FAILURE);

crypto/rsa/rsa_eay.c:130:12: Call
128.   		break;
129.   	case RSA_PKCS1_OAEP_PADDING:
130.   	        i=RSA_padding_add_PKCS1_OAEP(buf,num,from,flen,NULL,0);
                  ^
131.   		break;
132.   	case RSA_SSLV23_PADDING:

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

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

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

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

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

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