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


apps/x509.c:1119:1: start of procedure sign()
1117.   
1118.   /* self sign */
1119. > static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest, 
1120.   						LHASH *conf, char *section)
1121.   	{

apps/x509.c:1125:2: 
1123.   	EVP_PKEY *pktmp;
1124.   
1125. > 	pktmp = X509_get_pubkey(x);
1126.   	EVP_PKEY_copy_parameters(pktmp,pkey);
1127.   	EVP_PKEY_save_parameters(pktmp,1);

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

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

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

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

crypto/x509/x509_cmp.c:265:2: return from a call to X509_get_pubkey
  263.   		return(NULL);
  264.   	return(X509_PUBKEY_get(x->cert_info->key));
  265.   	}
          ^
  266.   
  267.   int X509_check_private_key(X509 *x, EVP_PKEY *k)

apps/x509.c:1126:2: Skipping EVP_PKEY_copy_parameters(): empty list of specs
1124.   
1125.   	pktmp = X509_get_pubkey(x);
1126.   	EVP_PKEY_copy_parameters(pktmp,pkey);
         ^
1127.   	EVP_PKEY_save_parameters(pktmp,1);
1128.   	EVP_PKEY_free(pktmp);

apps/x509.c:1127:2: 
1125.   	pktmp = X509_get_pubkey(x);
1126.   	EVP_PKEY_copy_parameters(pktmp,pkey);
1127. > 	EVP_PKEY_save_parameters(pktmp,1);
1128.   	EVP_PKEY_free(pktmp);
1129.   

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;
