crypto/x509/x509_req.c:123: error: NULL_DEREFERENCE
  pointer `xk` last assigned on line 122 could be null and is dereferenced by call to `EVP_PKEY_cmp()` at line 123, column 10.
Showing all 21 steps of the trace


crypto/x509/x509_req.c:117:1: start of procedure X509_REQ_check_private_key()
115.   	}
116.   
117. > int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
118.   	{
119.   	EVP_PKEY *xk=NULL;

crypto/x509/x509_req.c:119:2: 
117.   int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
118.   	{
119. > 	EVP_PKEY *xk=NULL;
120.   	int ok=0;
121.   

crypto/x509/x509_req.c:120:2: 
118.   	{
119.   	EVP_PKEY *xk=NULL;
120. > 	int ok=0;
121.   
122.   	xk=X509_REQ_get_pubkey(x);

crypto/x509/x509_req.c:122:2: 
120.   	int ok=0;
121.   
122. > 	xk=X509_REQ_get_pubkey(x);
123.   	switch (EVP_PKEY_cmp(xk, k))
124.   		{

crypto/x509/x509_req.c:110:1: start of procedure X509_REQ_get_pubkey()
  108.   	}
  109.   
  110. > EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
  111.   	{
  112.   	if ((req == NULL) || (req->req_info == NULL))

crypto/x509/x509_req.c:112:7: Taking false branch
  110.   EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
  111.   	{
  112.   	if ((req == NULL) || (req->req_info == NULL))
               ^
  113.   		return(NULL);
  114.   	return(X509_PUBKEY_get(req->req_info->pubkey));

crypto/x509/x509_req.c:112:24: Taking false branch
  110.   EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
  111.   	{
  112.   	if ((req == NULL) || (req->req_info == NULL))
                                ^
  113.   		return(NULL);
  114.   	return(X509_PUBKEY_get(req->req_info->pubkey));

crypto/x509/x509_req.c:114:2: 
  112.   	if ((req == NULL) || (req->req_info == NULL))
  113.   		return(NULL);
  114. > 	return(X509_PUBKEY_get(req->req_info->pubkey));
  115.   	}
  116.   

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:179:2: 
    177.   	return ret;
    178.   
    179. > 	error:
    180.   	if (ret != NULL)
    181.   		EVP_PKEY_free(ret);

crypto/asn1/x_pubkey.c:180:6: Taking false branch
    178.   
    179.   	error:
    180.   	if (ret != NULL)
                ^
    181.   		EVP_PKEY_free(ret);
    182.   	return(NULL);

crypto/asn1/x_pubkey.c:182:2: 
    180.   	if (ret != NULL)
    181.   		EVP_PKEY_free(ret);
    182. > 	return(NULL);
    183.   	}
    184.   

crypto/asn1/x_pubkey.c:183:2: return from a call to X509_PUBKEY_get
    181.   		EVP_PKEY_free(ret);
    182.   	return(NULL);
    183.   	}
            ^
    184.   
    185.   /* Now two pseudo ASN1 routines that take an EVP_PKEY structure

crypto/x509/x509_req.c:115:2: return from a call to X509_REQ_get_pubkey
  113.   		return(NULL);
  114.   	return(X509_PUBKEY_get(req->req_info->pubkey));
  115.   	}
          ^
  116.   
  117.   int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)

crypto/x509/x509_req.c:123:2: 
121.   
122.   	xk=X509_REQ_get_pubkey(x);
123. > 	switch (EVP_PKEY_cmp(xk, k))
124.   		{
125.   	case 1:

crypto/evp/p_lib.c:159:1: start of procedure EVP_PKEY_cmp()
  157.   	}
  158.   
  159. > int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
  160.   	{
  161.   	if (a->type != b->type)

crypto/evp/p_lib.c:161:6: 
  159.   int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
  160.   	{
  161. > 	if (a->type != b->type)
  162.   		return -1;
  163.   
