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


apps/x509.c:1203:1: start of procedure sign()
1201.   
1202.   /* self sign */
1203. > static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext,
1204.                   const EVP_MD *digest, CONF *conf, char *section)
1205.   {

apps/x509.c:1209:5: 
1207.       EVP_PKEY *pktmp;
1208.   
1209. >     pktmp = X509_get_pubkey(x);
1210.       EVP_PKEY_copy_parameters(pktmp, pkey);
1211.       EVP_PKEY_save_parameters(pktmp, 1);

crypto/x509/x509_cmp.c:306:1: start of procedure X509_get_pubkey()
  304.   }
  305.   
  306. > EVP_PKEY *X509_get_pubkey(X509 *x)
  307.   {
  308.       if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:308:10: Taking false branch
  306.   EVP_PKEY *X509_get_pubkey(X509 *x)
  307.   {
  308.       if ((x == NULL) || (x->cert_info == NULL))
                  ^
  309.           return (NULL);
  310.       return (X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:308:25: Taking true branch
  306.   EVP_PKEY *X509_get_pubkey(X509 *x)
  307.   {
  308.       if ((x == NULL) || (x->cert_info == NULL))
                                 ^
  309.           return (NULL);
  310.       return (X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:309:9: 
  307.   {
  308.       if ((x == NULL) || (x->cert_info == NULL))
  309. >         return (NULL);
  310.       return (X509_PUBKEY_get(x->cert_info->key));
  311.   }

crypto/x509/x509_cmp.c:311:1: return from a call to X509_get_pubkey
  309.           return (NULL);
  310.       return (X509_PUBKEY_get(x->cert_info->key));
  311. > }
  312.   
  313.   ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)

apps/x509.c:1210:5: 
1208.   
1209.       pktmp = X509_get_pubkey(x);
1210. >     EVP_PKEY_copy_parameters(pktmp, pkey);
1211.       EVP_PKEY_save_parameters(pktmp, 1);
1212.       EVP_PKEY_free(pktmp);
