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


apps/x509.c:760:1: start of procedure x509_certify()
758.   	}
759.   
760. > static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
761.   	     X509 *x, X509 *xca, EVP_PKEY *pkey, char *serialfile, int create,
762.   	     int days, LHASH *conf, char *section)

apps/x509.c:764:2: 
762.   	     int days, LHASH *conf, char *section)
763.   	{
764. > 	int ret=0;
765.   	BIO *io=NULL;
766.   	MS_STATIC char buf2[1024];

apps/x509.c:765:2: 
763.   	{
764.   	int ret=0;
765. > 	BIO *io=NULL;
766.   	MS_STATIC char buf2[1024];
767.   	char *buf=NULL,*p;

apps/x509.c:767:2: 
765.   	BIO *io=NULL;
766.   	MS_STATIC char buf2[1024];
767. > 	char *buf=NULL,*p;
768.   	BIGNUM *serial=NULL;
769.   	ASN1_INTEGER *bs=NULL,bs2;

apps/x509.c:768:2: 
766.   	MS_STATIC char buf2[1024];
767.   	char *buf=NULL,*p;
768. > 	BIGNUM *serial=NULL;
769.   	ASN1_INTEGER *bs=NULL,bs2;
770.   	X509_STORE_CTX xsc;

apps/x509.c:769:2: 
767.   	char *buf=NULL,*p;
768.   	BIGNUM *serial=NULL;
769. > 	ASN1_INTEGER *bs=NULL,bs2;
770.   	X509_STORE_CTX xsc;
771.   	EVP_PKEY *upkey;

apps/x509.c:773:2: 
771.   	EVP_PKEY *upkey;
772.   
773. > 	upkey = X509_get_pubkey(xca);
774.   	EVP_PKEY_copy_parameters(upkey,pkey);
775.   	EVP_PKEY_free(upkey);

crypto/x509/x509_cmp.c:239:1: start of procedure X509_get_pubkey()
  237.   	}
  238.   
  239. > EVP_PKEY *X509_get_pubkey(X509 *x)
  240.   	{
  241.   	if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:241:7: Taking false branch
  239.   EVP_PKEY *X509_get_pubkey(X509 *x)
  240.   	{
  241.   	if ((x == NULL) || (x->cert_info == NULL))
               ^
  242.   		return(NULL);
  243.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:241:22: Taking true branch
  239.   EVP_PKEY *X509_get_pubkey(X509 *x)
  240.   	{
  241.   	if ((x == NULL) || (x->cert_info == NULL))
                              ^
  242.   		return(NULL);
  243.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:242:3: 
  240.   	{
  241.   	if ((x == NULL) || (x->cert_info == NULL))
  242. > 		return(NULL);
  243.   	return(X509_PUBKEY_get(x->cert_info->key));
  244.   	}

crypto/x509/x509_cmp.c:244:2: return from a call to X509_get_pubkey
  242.   		return(NULL);
  243.   	return(X509_PUBKEY_get(x->cert_info->key));
  244.   	}
          ^
  245.   
  246.   int X509_check_private_key(X509 *x, EVP_PKEY *k)

apps/x509.c:774:2: 
772.   
773.   	upkey = X509_get_pubkey(xca);
774. > 	EVP_PKEY_copy_parameters(upkey,pkey);
775.   	EVP_PKEY_free(upkey);
776.   
