crypto/rsa/rsa_eay.c:120: error: BUFFER_OVERRUN_L3
  Offset: [21, +oo] (⇐ 21 + [0, +oo]) Size: [0, +oo] by call to `RSA_padding_add_PKCS1_OAEP`.
Showing all 10 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: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:17:1: <Offset 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 `flen`
  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: <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:46:5: Assignment
  44.       to[0] = 0;
  45.       seed = to + 1;
  46.       db = to + SHA_DIGEST_LENGTH + 1;
            ^
  47.   
  48.       SHA1(param, plen, db);

crypto/rsa/rsa_oaep.c:62:2: Array access: Offset: [21, +oo] (⇐ 21 + [0, +oo]) Size: [0, +oo] by call to `RSA_padding_add_PKCS1_OAEP` 
  60.       MGF1(dbmask, emlen - SHA_DIGEST_LENGTH, seed, SHA_DIGEST_LENGTH);
  61.       for (i = 0; i < emlen - SHA_DIGEST_LENGTH; i++)
  62.   	db[i] ^= dbmask[i];
         ^
  63.   
  64.       MGF1(seedmask, SHA_DIGEST_LENGTH, db, emlen - SHA_DIGEST_LENGTH);
