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


apps/x509.c:1233:1: start of procedure sign()
1231.   
1232.   /* self sign */
1233. > static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest, 
1234.   						LHASH *conf, char *section)
1235.   	{

apps/x509.c:1239:2: 
1237.   	EVP_PKEY *pktmp;
1238.   
1239. > 	pktmp = X509_get_pubkey(x);
1240.   	EVP_PKEY_copy_parameters(pktmp,pkey);
1241.   	EVP_PKEY_save_parameters(pktmp,1);

crypto/x509/x509_cmp.c:254:1: start of procedure X509_get_pubkey()
  252.   	}
  253.   
  254. > EVP_PKEY *X509_get_pubkey(X509 *x)
  255.   	{
  256.   	if ((x == NULL) || (x->cert_info == NULL))

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

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

crypto/x509/x509_cmp.c:257:3: 
  255.   	{
  256.   	if ((x == NULL) || (x->cert_info == NULL))
  257. > 		return(NULL);
  258.   	return(X509_PUBKEY_get(x->cert_info->key));
  259.   	}

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

apps/x509.c:1240:2: Skipping EVP_PKEY_copy_parameters(): empty list of specs
1238.   
1239.   	pktmp = X509_get_pubkey(x);
1240.   	EVP_PKEY_copy_parameters(pktmp,pkey);
         ^
1241.   	EVP_PKEY_save_parameters(pktmp,1);
1242.   	EVP_PKEY_free(pktmp);

apps/x509.c:1241:2: 
1239.   	pktmp = X509_get_pubkey(x);
1240.   	EVP_PKEY_copy_parameters(pktmp,pkey);
1241. > 	EVP_PKEY_save_parameters(pktmp,1);
1242.   	EVP_PKEY_free(pktmp);
1243.   

crypto/evp/p_lib.c:97:1: start of procedure EVP_PKEY_save_parameters()
  95.   	}
  96.   
  97. > int EVP_PKEY_save_parameters(EVP_PKEY *pkey, int mode)
  98.   	{
  99.   #ifndef NO_DSA

crypto/evp/p_lib.c:100:6: 
  98.   	{
  99.   #ifndef NO_DSA
  100. > 	if (pkey->type == EVP_PKEY_DSA)
  101.   		{
  102.   		int ret=pkey->save_parameters=mode;
