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


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

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

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

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

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

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

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

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

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