apps/x509.c:1059: error: NULL_DEREFERENCE
  pointer `pktmp` last assigned on line 1058 could be null and is dereferenced by call to `EVP_PKEY_copy_parameters()` at line 1059, column 2.
Showing all 8 steps of the trace


apps/x509.c:1052:1: start of procedure sign()
1050.   
1051.   /* self sign */
1052. > static int sign(X509 *x, EVP_PKEY *pkey, int days, const EVP_MD *digest, 
1053.   						LHASH *conf, char *section)
1054.   	{

apps/x509.c:1058:2: 
1056.   	EVP_PKEY *pktmp;
1057.   
1058. > 	pktmp = X509_get_pubkey(x);
1059.   	EVP_PKEY_copy_parameters(pktmp,pkey);
1060.   	EVP_PKEY_save_parameters(pktmp,1);

crypto/x509/x509_cmp.c:239:1: start of procedure X509_get_pubkey()
  237.   	}
  238.   
  239. > EVP_PKEY *X509_get_pubkey(X509 *x)
  240.   	{
  241.   	if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:241:7: Taking false branch
  239.   EVP_PKEY *X509_get_pubkey(X509 *x)
  240.   	{
  241.   	if ((x == NULL) || (x->cert_info == NULL))
               ^
  242.   		return(NULL);
  243.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:241:22: Taking true branch
  239.   EVP_PKEY *X509_get_pubkey(X509 *x)
  240.   	{
  241.   	if ((x == NULL) || (x->cert_info == NULL))
                              ^
  242.   		return(NULL);
  243.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:242:3: 
  240.   	{
  241.   	if ((x == NULL) || (x->cert_info == NULL))
  242. > 		return(NULL);
  243.   	return(X509_PUBKEY_get(x->cert_info->key));
  244.   	}

crypto/x509/x509_cmp.c:244:2: return from a call to X509_get_pubkey
  242.   		return(NULL);
  243.   	return(X509_PUBKEY_get(x->cert_info->key));
  244.   	}
          ^
  245.   
  246.   int X509_check_private_key(X509 *x, EVP_PKEY *k)

apps/x509.c:1059:2: 
1057.   
1058.   	pktmp = X509_get_pubkey(x);
1059. > 	EVP_PKEY_copy_parameters(pktmp,pkey);
1060.   	EVP_PKEY_save_parameters(pktmp,1);
1061.   	EVP_PKEY_free(pktmp);
