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


apps/x509.c:1187:1: start of procedure x509_certify()
1185.   	}
1186.   
1187. > static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
1188.   	     		X509 *x, X509 *xca, EVP_PKEY *pkey,
1189.   			STACK_OF(OPENSSL_STRING) *sigopts,

apps/x509.c:1194:2: 
1192.   			ASN1_INTEGER *sno)
1193.   	{
1194. > 	int ret=0;
1195.   	ASN1_INTEGER *bs=NULL;
1196.   	X509_STORE_CTX xsc;

apps/x509.c:1195:2: 
1193.   	{
1194.   	int ret=0;
1195. > 	ASN1_INTEGER *bs=NULL;
1196.   	X509_STORE_CTX xsc;
1197.   	EVP_PKEY *upkey;

apps/x509.c:1199:2: 
1197.   	EVP_PKEY *upkey;
1198.   
1199. > 	upkey = X509_get_pubkey(xca);
1200.   	EVP_PKEY_copy_parameters(upkey,pkey);
1201.   	EVP_PKEY_free(upkey);

crypto/x509/x509_cmp.c:300:1: start of procedure X509_get_pubkey()
  298.   	}
  299.   
  300. > EVP_PKEY *X509_get_pubkey(X509 *x)
  301.   	{
  302.   	if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:302:7: Taking false branch
  300.   EVP_PKEY *X509_get_pubkey(X509 *x)
  301.   	{
  302.   	if ((x == NULL) || (x->cert_info == NULL))
               ^
  303.   		return(NULL);
  304.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:302:22: Taking false branch
  300.   EVP_PKEY *X509_get_pubkey(X509 *x)
  301.   	{
  302.   	if ((x == NULL) || (x->cert_info == NULL))
                              ^
  303.   		return(NULL);
  304.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:304:2: 
  302.   	if ((x == NULL) || (x->cert_info == NULL))
  303.   		return(NULL);
  304. > 	return(X509_PUBKEY_get(x->cert_info->key));
  305.   	}
  306.   

crypto/asn1/x_pubkey.c:133:1: start of procedure X509_PUBKEY_get()
    131.   	}
    132.   
    133. > EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
    134.   	{
    135.   	EVP_PKEY *ret=NULL;

crypto/asn1/x_pubkey.c:135:2: 
    133.   EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
    134.   	{
    135. > 	EVP_PKEY *ret=NULL;
    136.   
    137.   	if (key == NULL) goto error;

crypto/asn1/x_pubkey.c:137:6: Taking false branch
    135.   	EVP_PKEY *ret=NULL;
    136.   
    137.   	if (key == NULL) goto error;
                ^
    138.   
    139.   	if (key->pkey != NULL)

crypto/asn1/x_pubkey.c:139:6: Taking false branch
    137.   	if (key == NULL) goto error;
    138.   
    139.   	if (key->pkey != NULL)
                ^
    140.   		{
    141.   		CRYPTO_add(&key->pkey->references, 1, CRYPTO_LOCK_EVP_PKEY);

crypto/asn1/x_pubkey.c:145:6: Taking true branch
    143.   		}
    144.   
    145.   	if (key->public_key == NULL) goto error;
                ^
    146.   
    147.   	if ((ret = EVP_PKEY_new()) == NULL)

crypto/asn1/x_pubkey.c:191:2: 
    189.   	return ret;
    190.   
    191. > 	error:
    192.   	if (ret != NULL)
    193.   		EVP_PKEY_free(ret);

crypto/asn1/x_pubkey.c:192:6: Taking false branch
    190.   
    191.   	error:
    192.   	if (ret != NULL)
                ^
    193.   		EVP_PKEY_free(ret);
    194.   	return(NULL);

crypto/asn1/x_pubkey.c:194:2: 
    192.   	if (ret != NULL)
    193.   		EVP_PKEY_free(ret);
    194. > 	return(NULL);
    195.   	}
    196.   

crypto/asn1/x_pubkey.c:195:2: return from a call to X509_PUBKEY_get
    193.   		EVP_PKEY_free(ret);
    194.   	return(NULL);
    195.   	}
            ^
    196.   
    197.   /* Now two pseudo ASN1 routines that take an EVP_PKEY structure

crypto/x509/x509_cmp.c:305:2: return from a call to X509_get_pubkey
  303.   		return(NULL);
  304.   	return(X509_PUBKEY_get(x->cert_info->key));
  305.   	}
          ^
  306.   
  307.   ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)

apps/x509.c:1200:2: 
1198.   
1199.   	upkey = X509_get_pubkey(xca);
1200. > 	EVP_PKEY_copy_parameters(upkey,pkey);
1201.   	EVP_PKEY_free(upkey);
1202.   
