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


apps/x509.c:982:1: start of procedure x509_certify()
980.   }
981.   
982. > static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
983.                           X509 *x, X509 *xca, EVP_PKEY *pkey,
984.                           STACK_OF(OPENSSL_STRING) *sigopts,

apps/x509.c:989:5: 
987.                           ASN1_INTEGER *sno, int reqfile)
988.   {
989. >     int ret = 0;
990.       ASN1_INTEGER *bs = NULL;
991.       X509_STORE_CTX xsc;

apps/x509.c:990:5: 
988.   {
989.       int ret = 0;
990. >     ASN1_INTEGER *bs = NULL;
991.       X509_STORE_CTX xsc;
992.       EVP_PKEY *upkey;

apps/x509.c:994:5: 
992.       EVP_PKEY *upkey;
993.   
994. >     upkey = X509_get_pubkey(xca);
995.       EVP_PKEY_copy_parameters(upkey, pkey);
996.       EVP_PKEY_free(upkey);

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

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

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

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

apps/x509.c:995:5: 
993.   
994.       upkey = X509_get_pubkey(xca);
995. >     EVP_PKEY_copy_parameters(upkey, pkey);
996.       EVP_PKEY_free(upkey);
997.   
