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


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

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

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

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

crypto/x509/x509_cmp.c:310:1: start of procedure X509_get_pubkey()
  308.   }
  309.   
  310. > EVP_PKEY *X509_get_pubkey(X509 *x)
  311.   {
  312.       if ((x == NULL) || (x->cert_info == NULL))

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

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

crypto/x509/x509_cmp.c:313:9: 
  311.   {
  312.       if ((x == NULL) || (x->cert_info == NULL))
  313. >         return (NULL);
  314.       return (X509_PUBKEY_get(x->cert_info->key));
  315.   }

crypto/x509/x509_cmp.c:315:1: return from a call to X509_get_pubkey
  313.           return (NULL);
  314.       return (X509_PUBKEY_get(x->cert_info->key));
  315. > }
  316.   
  317.   ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)

apps/x509.c:1100:5: 
1098.   
1099.       upkey = X509_get_pubkey(xca);
1100. >     EVP_PKEY_copy_parameters(upkey, pkey);
1101.       EVP_PKEY_free(upkey);
1102.   
