ssl/ssl_rsa.c:197: error: NULL_DEREFERENCE
  pointer `pktmp` last assigned on line 196 could be null and is dereferenced by call to `EVP_PKEY_copy_parameters()` at line 197, column 3.
Showing all 20 steps of the trace


ssl/ssl_rsa.c:182:1: start of procedure ssl_set_pkey()
180.   #endif
181.   
182. > static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey)
183.   	{
184.   	int i;

ssl/ssl_rsa.c:186:2: Skipping ssl_cert_type(): empty list of specs
184.   	int i;
185.   
186.   	i=ssl_cert_type(NULL,pkey);
        ^
187.   	if (i < 0)
188.   		{

ssl/ssl_rsa.c:187:6: Taking false branch
185.   
186.   	i=ssl_cert_type(NULL,pkey);
187.   	if (i < 0)
            ^
188.   		{
189.   		SSLerr(SSL_F_SSL_SET_PKEY,SSL_R_UNKNOWN_CERTIFICATE_TYPE);

ssl/ssl_rsa.c:193:6: Taking true branch
191.   		}
192.   
193.   	if (c->pkeys[i].x509 != NULL)
            ^
194.   		{
195.   		EVP_PKEY *pktmp;

ssl/ssl_rsa.c:196:3: 
194.   		{
195.   		EVP_PKEY *pktmp;
196. > 		pktmp =	X509_get_pubkey(c->pkeys[i].x509);
197.   		EVP_PKEY_copy_parameters(pktmp,pkey);
198.   		EVP_PKEY_free(pktmp);

crypto/x509/x509_cmp.c:258:1: start of procedure X509_get_pubkey()
  256.   	}
  257.   
  258. > EVP_PKEY *X509_get_pubkey(X509 *x)
  259.   	{
  260.   	if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:260:7: Taking false branch
  258.   EVP_PKEY *X509_get_pubkey(X509 *x)
  259.   	{
  260.   	if ((x == NULL) || (x->cert_info == NULL))
               ^
  261.   		return(NULL);
  262.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:260:22: Taking false branch
  258.   EVP_PKEY *X509_get_pubkey(X509 *x)
  259.   	{
  260.   	if ((x == NULL) || (x->cert_info == NULL))
                              ^
  261.   		return(NULL);
  262.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:262:2: 
  260.   	if ((x == NULL) || (x->cert_info == NULL))
  261.   		return(NULL);
  262. > 	return(X509_PUBKEY_get(x->cert_info->key));
  263.   	}
  264.   

crypto/asn1/x_pubkey.c:133:1: start of procedure X509_PUBKEY_get()
    131.   	}
    132.   
    133. > EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
    134.   	{
    135.   	EVP_PKEY *ret=NULL;

crypto/asn1/x_pubkey.c:135:2: 
    133.   EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
    134.   	{
    135. > 	EVP_PKEY *ret=NULL;
    136.   
    137.   	if (key == NULL) goto error;

crypto/asn1/x_pubkey.c:137:6: Taking false branch
    135.   	EVP_PKEY *ret=NULL;
    136.   
    137.   	if (key == NULL) goto error;
                ^
    138.   
    139.   	if (key->pkey != NULL)

crypto/asn1/x_pubkey.c:139:6: Taking false branch
    137.   	if (key == NULL) goto error;
    138.   
    139.   	if (key->pkey != NULL)
                ^
    140.   		{
    141.   		CRYPTO_add(&key->pkey->references, 1, CRYPTO_LOCK_EVP_PKEY);

crypto/asn1/x_pubkey.c:145:6: Taking true branch
    143.   		}
    144.   
    145.   	if (key->public_key == NULL) goto error;
                ^
    146.   
    147.   	if ((ret = EVP_PKEY_new()) == NULL)

crypto/asn1/x_pubkey.c:179:2: 
    177.   	return ret;
    178.   
    179. > 	error:
    180.   	if (ret != NULL)
    181.   		EVP_PKEY_free(ret);

crypto/asn1/x_pubkey.c:180:6: Taking false branch
    178.   
    179.   	error:
    180.   	if (ret != NULL)
                ^
    181.   		EVP_PKEY_free(ret);
    182.   	return(NULL);

crypto/asn1/x_pubkey.c:182:2: 
    180.   	if (ret != NULL)
    181.   		EVP_PKEY_free(ret);
    182. > 	return(NULL);
    183.   	}
    184.   

crypto/asn1/x_pubkey.c:183:2: return from a call to X509_PUBKEY_get
    181.   		EVP_PKEY_free(ret);
    182.   	return(NULL);
    183.   	}
            ^
    184.   
    185.   /* Now two pseudo ASN1 routines that take an EVP_PKEY structure

crypto/x509/x509_cmp.c:263:2: return from a call to X509_get_pubkey
  261.   		return(NULL);
  262.   	return(X509_PUBKEY_get(x->cert_info->key));
  263.   	}
          ^
  264.   
  265.   ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)

ssl/ssl_rsa.c:197:3: 
195.   		EVP_PKEY *pktmp;
196.   		pktmp =	X509_get_pubkey(c->pkeys[i].x509);
197. > 		EVP_PKEY_copy_parameters(pktmp,pkey);
198.   		EVP_PKEY_free(pktmp);
199.   		ERR_clear_error();
