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


apps/x509.c:897:1: start of procedure x509_certify()
895.   	}
896.   
897. > static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
898.   	     X509 *x, X509 *xca, EVP_PKEY *pkey, char *serialfile, int create,
899.   	     int days, int clrext, LHASH *conf, char *section)

apps/x509.c:901:2: 
899.   	     int days, int clrext, LHASH *conf, char *section)
900.   	{
901. > 	int ret=0;
902.   	BIO *io=NULL;
903.   	MS_STATIC char buf2[1024];

apps/x509.c:902:2: 
900.   	{
901.   	int ret=0;
902. > 	BIO *io=NULL;
903.   	MS_STATIC char buf2[1024];
904.   	char *buf=NULL,*p;

apps/x509.c:904:2: 
902.   	BIO *io=NULL;
903.   	MS_STATIC char buf2[1024];
904. > 	char *buf=NULL,*p;
905.   	BIGNUM *serial=NULL;
906.   	ASN1_INTEGER *bs=NULL,bs2;

apps/x509.c:905:2: 
903.   	MS_STATIC char buf2[1024];
904.   	char *buf=NULL,*p;
905. > 	BIGNUM *serial=NULL;
906.   	ASN1_INTEGER *bs=NULL,bs2;
907.   	X509_STORE_CTX xsc;

apps/x509.c:906:2: 
904.   	char *buf=NULL,*p;
905.   	BIGNUM *serial=NULL;
906. > 	ASN1_INTEGER *bs=NULL,bs2;
907.   	X509_STORE_CTX xsc;
908.   	EVP_PKEY *upkey;

apps/x509.c:910:2: 
908.   	EVP_PKEY *upkey;
909.   
910. > 	upkey = X509_get_pubkey(xca);
911.   	EVP_PKEY_copy_parameters(upkey,pkey);
912.   	EVP_PKEY_free(upkey);

crypto/x509/x509_cmp.c:254:1: start of procedure X509_get_pubkey()
  252.   	}
  253.   
  254. > EVP_PKEY *X509_get_pubkey(X509 *x)
  255.   	{
  256.   	if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:256:7: Taking false branch
  254.   EVP_PKEY *X509_get_pubkey(X509 *x)
  255.   	{
  256.   	if ((x == NULL) || (x->cert_info == NULL))
               ^
  257.   		return(NULL);
  258.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:256:22: Taking true branch
  254.   EVP_PKEY *X509_get_pubkey(X509 *x)
  255.   	{
  256.   	if ((x == NULL) || (x->cert_info == NULL))
                              ^
  257.   		return(NULL);
  258.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:257:3: 
  255.   	{
  256.   	if ((x == NULL) || (x->cert_info == NULL))
  257. > 		return(NULL);
  258.   	return(X509_PUBKEY_get(x->cert_info->key));
  259.   	}

crypto/x509/x509_cmp.c:259:2: return from a call to X509_get_pubkey
  257.   		return(NULL);
  258.   	return(X509_PUBKEY_get(x->cert_info->key));
  259.   	}
          ^
  260.   
  261.   int X509_check_private_key(X509 *x, EVP_PKEY *k)

apps/x509.c:911:2: Skipping EVP_PKEY_copy_parameters(): empty list of specs
909.   
910.   	upkey = X509_get_pubkey(xca);
911.   	EVP_PKEY_copy_parameters(upkey,pkey);
        ^
912.   	EVP_PKEY_free(upkey);
913.   

apps/x509.c:912:2: 
910.   	upkey = X509_get_pubkey(xca);
911.   	EVP_PKEY_copy_parameters(upkey,pkey);
912. > 	EVP_PKEY_free(upkey);
913.   
914.   	X509_STORE_CTX_init(&xsc,ctx,x,NULL);
