crypto/rsa/rsa_eay.c:127: error: BUFFER_OVERRUN_L3
  Offset: [2, +oo] Size: [0, +oo] by call to `RSA_padding_add_PKCS1_type_2`.
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:127:5: Call
125.   		{
126.   	case RSA_PKCS1_PADDING:
127.   		i=RSA_padding_add_PKCS1_type_2(buf,num,from,flen);
           ^
128.   		break;
129.   	case RSA_PKCS1_OAEP_PADDING:

crypto/rsa/rsa_pk1.c:150:1: <Length trace>
148.   	}
149.   
150. > int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
151.   	     unsigned char *from, int flen)
152.   	{

crypto/rsa/rsa_pk1.c:150:1: Parameter `*to`
  148.   	}
  149.   
  150. > int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
  151.   	     unsigned char *from, int flen)
  152.   	{

crypto/rsa/rsa_pk1.c:162:2: Assignment
  160.   		}
  161.   	
  162.   	p=(unsigned char *)to;
          ^
  163.   
  164.   	*(p++)=0;

crypto/rsa/rsa_pk1.c:164:4: Assignment
  162.   	p=(unsigned char *)to;
  163.   
  164.   	*(p++)=0;
            ^
  165.   	*(p++)=2; /* Public Key BT (Block Type) */
  166.   

crypto/rsa/rsa_pk1.c:165:4: Assignment
  163.   
  164.   	*(p++)=0;
  165.   	*(p++)=2; /* Public Key BT (Block Type) */
            ^
  166.   
  167.   	/* pad out with non-zero random data */

crypto/rsa/rsa_pk1.c:173:7: Array access: Offset: [2, +oo] Size: [0, +oo] by call to `RSA_padding_add_PKCS1_type_2` 
  171.   	for (i=0; i<j; i++)
  172.   		{
  173.   		if (*p == '\0')
               ^
  174.   			do	{
  175.   				RAND_bytes(p,1);
