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


apps/x509.c:1192:1: start of procedure sign()
1190.   
1191.   /* self sign */
1192. > static int sign(X509 *x, EVP_PKEY *pkey, int days, const EVP_MD *digest, 
1193.   						LHASH *conf, char *section)
1194.   	{

apps/x509.c:1198:2: 
1196.   	EVP_PKEY *pktmp;
1197.   
1198. > 	pktmp = X509_get_pubkey(x);
1199.   	EVP_PKEY_copy_parameters(pktmp,pkey);
1200.   	EVP_PKEY_save_parameters(pktmp,1);

crypto/x509/x509_cmp.c:250:1: start of procedure X509_get_pubkey()
  248.   	}
  249.   
  250. > EVP_PKEY *X509_get_pubkey(X509 *x)
  251.   	{
  252.   	if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:252:7: Taking false branch
  250.   EVP_PKEY *X509_get_pubkey(X509 *x)
  251.   	{
  252.   	if ((x == NULL) || (x->cert_info == NULL))
               ^
  253.   		return(NULL);
  254.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:252:22: Taking true branch
  250.   EVP_PKEY *X509_get_pubkey(X509 *x)
  251.   	{
  252.   	if ((x == NULL) || (x->cert_info == NULL))
                              ^
  253.   		return(NULL);
  254.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:253:3: 
  251.   	{
  252.   	if ((x == NULL) || (x->cert_info == NULL))
  253. > 		return(NULL);
  254.   	return(X509_PUBKEY_get(x->cert_info->key));
  255.   	}

crypto/x509/x509_cmp.c:255:2: return from a call to X509_get_pubkey
  253.   		return(NULL);
  254.   	return(X509_PUBKEY_get(x->cert_info->key));
  255.   	}
          ^
  256.   
  257.   int X509_check_private_key(X509 *x, EVP_PKEY *k)

apps/x509.c:1199:2: 
1197.   
1198.   	pktmp = X509_get_pubkey(x);
1199. > 	EVP_PKEY_copy_parameters(pktmp,pkey);
1200.   	EVP_PKEY_save_parameters(pktmp,1);
1201.   	EVP_PKEY_free(pktmp);
