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


apps/x509.c:1085:1: start of procedure x509_certify()
1083.   }
1084.   
1085. > static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
1086.                           X509 *x, X509 *xca, EVP_PKEY *pkey,
1087.                           STACK_OF(OPENSSL_STRING) *sigopts,

apps/x509.c:1092:5: 
1090.                           ASN1_INTEGER *sno)
1091.   {
1092. >     int ret = 0;
1093.       ASN1_INTEGER *bs = NULL;
1094.       X509_STORE_CTX xsc;

apps/x509.c:1093:5: 
1091.   {
1092.       int ret = 0;
1093. >     ASN1_INTEGER *bs = NULL;
1094.       X509_STORE_CTX xsc;
1095.       EVP_PKEY *upkey;

apps/x509.c:1097:5: 
1095.       EVP_PKEY *upkey;
1096.   
1097. >     upkey = X509_get_pubkey(xca);
1098.       EVP_PKEY_copy_parameters(upkey, pkey);
1099.       EVP_PKEY_free(upkey);

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:1098:5: 
1096.   
1097.       upkey = X509_get_pubkey(xca);
1098. >     EVP_PKEY_copy_parameters(upkey, pkey);
1099.       EVP_PKEY_free(upkey);
1100.   
