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


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

apps/x509.c:985:5: 
983.                           ASN1_INTEGER *sno, int reqfile)
984.   {
985. >     int ret = 0;
986.       ASN1_INTEGER *bs = NULL;
987.       X509_STORE_CTX xsc;

apps/x509.c:986:5: 
984.   {
985.       int ret = 0;
986. >     ASN1_INTEGER *bs = NULL;
987.       X509_STORE_CTX xsc;
988.       EVP_PKEY *upkey;

apps/x509.c:990:5: 
988.       EVP_PKEY *upkey;
989.   
990. >     upkey = X509_get0_pubkey(xca);
991.       EVP_PKEY_copy_parameters(upkey, pkey);
992.   

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

crypto/x509/x509_cmp.c:309:9: Taking true branch
  307.   EVP_PKEY *X509_get0_pubkey(X509 *x)
  308.   {
  309.       if (x == NULL)
                 ^
  310.           return NULL;
  311.       return X509_PUBKEY_get0(x->cert_info.key);

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

crypto/x509/x509_cmp.c:312:1: return from a call to X509_get0_pubkey
  310.           return NULL;
  311.       return X509_PUBKEY_get0(x->cert_info.key);
  312. > }
  313.   
  314.   EVP_PKEY *X509_get_pubkey(X509 *x)

apps/x509.c:991:5: 
989.   
990.       upkey = X509_get0_pubkey(xca);
991. >     EVP_PKEY_copy_parameters(upkey, pkey);
992.   
993.       if (!X509_STORE_CTX_init(&xsc, ctx, x, NULL)) {
