ssl/s3_srvr.c:2203: error: NULL_DEREFERENCE
  pointer `clnt_pub_pkey` last assigned on line 1677 could be null and is dereferenced by call to `EVP_PKEY_free()` at line 2203, column 2.
Showing all 38 steps of the trace


ssl/s3_srvr.c:1657:1: start of procedure ssl3_get_client_key_exchange()
1655.   #endif	/* OPENSSL_NO_ECDH */
1656.   
1657. > int ssl3_get_client_key_exchange(SSL *s)
1658.   	{
1659.   	int i,al,ok;

ssl/s3_srvr.c:1664:2: 
1662.   	unsigned char *p;
1663.   #ifndef OPENSSL_NO_RSA
1664. > 	RSA *rsa=NULL;
1665.   	EVP_PKEY *pkey=NULL;
1666.   #endif

ssl/s3_srvr.c:1665:2: 
1663.   #ifndef OPENSSL_NO_RSA
1664.   	RSA *rsa=NULL;
1665. > 	EVP_PKEY *pkey=NULL;
1666.   #endif
1667.   #ifndef OPENSSL_NO_DH

ssl/s3_srvr.c:1668:2: 
1666.   #endif
1667.   #ifndef OPENSSL_NO_DH
1668. > 	BIGNUM *pub=NULL;
1669.   	DH *dh_srvr;
1670.   #endif

ssl/s3_srvr.c:1676:2: 
1674.   
1675.   #ifndef OPENSSL_NO_ECDH
1676. > 	EC_KEY *srvr_ecdh = NULL;
1677.   	EVP_PKEY *clnt_pub_pkey = NULL;
1678.   	EC_POINT *clnt_ecpoint = NULL;

ssl/s3_srvr.c:1677:2: 
1675.   #ifndef OPENSSL_NO_ECDH
1676.   	EC_KEY *srvr_ecdh = NULL;
1677. > 	EVP_PKEY *clnt_pub_pkey = NULL;
1678.   	EC_POINT *clnt_ecpoint = NULL;
1679.   	BN_CTX *bn_ctx = NULL; 

ssl/s3_srvr.c:1678:2: 
1676.   	EC_KEY *srvr_ecdh = NULL;
1677.   	EVP_PKEY *clnt_pub_pkey = NULL;
1678. > 	EC_POINT *clnt_ecpoint = NULL;
1679.   	BN_CTX *bn_ctx = NULL; 
1680.   #endif

ssl/s3_srvr.c:1679:2: 
1677.   	EVP_PKEY *clnt_pub_pkey = NULL;
1678.   	EC_POINT *clnt_ecpoint = NULL;
1679. > 	BN_CTX *bn_ctx = NULL; 
1680.   #endif
1681.   

ssl/s3_srvr.c:1682:2: Skipping __function_pointer__(): unresolved function pointer
1680.   #endif
1681.   
1682.   	n=s->method->ssl_get_message(s,
         ^
1683.   		SSL3_ST_SR_KEY_EXCH_A,
1684.   		SSL3_ST_SR_KEY_EXCH_B,

ssl/s3_srvr.c:1689:7: Taking false branch
1687.   		&ok);
1688.   
1689.   	if (!ok) return((int)n);
              ^
1690.   	p=(unsigned char *)s->init_msg;
1691.   

ssl/s3_srvr.c:1690:2: 
1688.   
1689.   	if (!ok) return((int)n);
1690. > 	p=(unsigned char *)s->init_msg;
1691.   
1692.   	l=s->s3->tmp.new_cipher->algorithms;

ssl/s3_srvr.c:1692:2: 
1690.   	p=(unsigned char *)s->init_msg;
1691.   
1692. > 	l=s->s3->tmp.new_cipher->algorithms;
1693.   
1694.   #ifndef OPENSSL_NO_RSA

ssl/s3_srvr.c:1695:6: Taking true branch
1693.   
1694.   #ifndef OPENSSL_NO_RSA
1695.   	if (l & SSL_kRSA)
             ^
1696.   		{
1697.   		/* FIX THIS UP EAY EAY EAY EAY */

ssl/s3_srvr.c:1698:7: Taking false branch
1696.   		{
1697.   		/* FIX THIS UP EAY EAY EAY EAY */
1698.   		if (s->s3->tmp.use_rsa_tmp)
              ^
1699.   			{
1700.   			if ((s->cert != NULL) && (s->cert->rsa_tmp != NULL))

ssl/s3_srvr.c:1714:4: 
1712.   		else
1713.   			{
1714. > 			pkey=s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey;
1715.   			if (	(pkey == NULL) ||
1716.   				(pkey->type != EVP_PKEY_RSA) ||

ssl/s3_srvr.c:1715:10: Taking false branch
1713.   			{
1714.   			pkey=s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey;
1715.   			if (	(pkey == NULL) ||
                 ^
1716.   				(pkey->type != EVP_PKEY_RSA) ||
1717.   				(pkey->pkey.rsa == NULL))

ssl/s3_srvr.c:1716:6: Taking false branch
1714.   			pkey=s->cert->pkeys[SSL_PKEY_RSA_ENC].privatekey;
1715.   			if (	(pkey == NULL) ||
1716.   				(pkey->type != EVP_PKEY_RSA) ||
             ^
1717.   				(pkey->pkey.rsa == NULL))
1718.   				{

ssl/s3_srvr.c:1717:6: Taking false branch
1715.   			if (	(pkey == NULL) ||
1716.   				(pkey->type != EVP_PKEY_RSA) ||
1717.   				(pkey->pkey.rsa == NULL))
             ^
1718.   				{
1719.   				al=SSL_AD_HANDSHAKE_FAILURE;

ssl/s3_srvr.c:1723:4: 
1721.   				goto f_err;
1722.   				}
1723. > 			rsa=pkey->pkey.rsa;
1724.   			}
1725.   

ssl/s3_srvr.c:1727:7: Taking true branch
1725.   
1726.   		/* TLS */
1727.   		if (s->version > SSL3_VERSION)
              ^
1728.   			{
1729.   			n2s(p,i);

ssl/s3_srvr.c:1729:4: 
1727.   		if (s->version > SSL3_VERSION)
1728.   			{
1729. > 			n2s(p,i);
1730.   			if (n != i+2)
1731.   				{

ssl/s3_srvr.c:1730:8: Taking true branch
1728.   			{
1729.   			n2s(p,i);
1730.   			if (n != i+2)
               ^
1731.   				{
1732.   				if (!(s->options & SSL_OP_TLS_D5_BUG))

ssl/s3_srvr.c:1732:11: Taking true branch
1730.   			if (n != i+2)
1731.   				{
1732.   				if (!(s->options & SSL_OP_TLS_D5_BUG))
                  ^
1733.   					{
1734.   					SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG);

ssl/s3_srvr.c:1734:6: 
1732.   				if (!(s->options & SSL_OP_TLS_D5_BUG))
1733.   					{
1734. > 					SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG);
1735.   					goto err;
1736.   					}

crypto/err/err.c:666:1: start of procedure ERR_put_error()
  664.   /********************************************************/
  665.   
  666. > void ERR_put_error(int lib, int func, int reason, const char *file,
  667.   	     int line)
  668.   	{

crypto/err/err.c:690:2: Skipping ERR_get_state(): empty list of specs
  688.   	}
  689.   #endif
  690.   	es=ERR_get_state();
          ^
  691.   
  692.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:692:2: 
  690.   	es=ERR_get_state();
  691.   
  692. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
  693.   	if (es->top == es->bottom)
  694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:693:6: Taking false branch
  691.   
  692.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
  693.   	if (es->top == es->bottom)
              ^
  694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  695.   	es->err_flags[es->top]=0;

crypto/err/err.c:695:2: 
  693.   	if (es->top == es->bottom)
  694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  695. > 	es->err_flags[es->top]=0;
  696.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  697.   	es->err_file[es->top]=file;

crypto/err/err.c:696:2: 
  694.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
  695.   	es->err_flags[es->top]=0;
  696. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  697.   	es->err_file[es->top]=file;
  698.   	es->err_line[es->top]=line;

crypto/err/err.c:697:2: 
  695.   	es->err_flags[es->top]=0;
  696.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  697. > 	es->err_file[es->top]=file;
  698.   	es->err_line[es->top]=line;
  699.   	err_clear_data(es,es->top);

crypto/err/err.c:698:2: 
  696.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
  697.   	es->err_file[es->top]=file;
  698. > 	es->err_line[es->top]=line;
  699.   	err_clear_data(es,es->top);
  700.   	}

crypto/err/err.c:699:2: Taking true branch
  697.   	es->err_file[es->top]=file;
  698.   	es->err_line[es->top]=line;
  699.   	err_clear_data(es,es->top);
          ^
  700.   	}
  701.   

crypto/err/err.c:699:2: Taking false branch
  697.   	es->err_file[es->top]=file;
  698.   	es->err_line[es->top]=line;
  699.   	err_clear_data(es,es->top);
          ^
  700.   	}
  701.   

crypto/err/err.c:699:2: Loop condition is false. Leaving loop
  697.   	es->err_file[es->top]=file;
  698.   	es->err_line[es->top]=line;
  699.   	err_clear_data(es,es->top);
          ^
  700.   	}
  701.   

crypto/err/err.c:700:2: return from a call to ERR_put_error
  698.   	es->err_line[es->top]=line;
  699.   	err_clear_data(es,es->top);
  700.   	}
          ^
  701.   
  702.   void ERR_clear_error(void)

ssl/s3_srvr.c:2200:1: 
2198.   	ssl3_send_alert(s,SSL3_AL_FATAL,al);
2199.   #if !defined(OPENSSL_NO_DH) || !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_ECDH)
2200. > err:
2201.   #endif
2202.   #ifndef OPENSSL_NO_ECDH

ssl/s3_srvr.c:2203:2: 
2201.   #endif
2202.   #ifndef OPENSSL_NO_ECDH
2203. > 	EVP_PKEY_free(clnt_pub_pkey);
2204.   	EC_POINT_free(clnt_ecpoint);
2205.   	if (srvr_ecdh != NULL) 
