crypto/x509/x509_cmp.c:252: error: NULL_DEREFERENCE
  pointer `xk` last assigned on line 251 could be null and is dereferenced at line 252, column 6.
Showing all 10 steps of the trace


crypto/x509/x509_cmp.c:246:1: start of procedure X509_check_private_key()
244.   	}
245.   
246. > int X509_check_private_key(X509 *x, EVP_PKEY *k)
247.   	{
248.   	EVP_PKEY *xk=NULL;

crypto/x509/x509_cmp.c:248:2: 
246.   int X509_check_private_key(X509 *x, EVP_PKEY *k)
247.   	{
248. > 	EVP_PKEY *xk=NULL;
249.   	int ok=0;
250.   

crypto/x509/x509_cmp.c:249:2: 
247.   	{
248.   	EVP_PKEY *xk=NULL;
249. > 	int ok=0;
250.   
251.   	xk=X509_get_pubkey(x);

crypto/x509/x509_cmp.c:251:2: 
249.   	int ok=0;
250.   
251. > 	xk=X509_get_pubkey(x);
252.   	if (xk->type != k->type)
253.   	    {

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)

crypto/x509/x509_cmp.c:252:6: 
250.   
251.   	xk=X509_get_pubkey(x);
252. > 	if (xk->type != k->type)
253.   	    {
254.   	    X509err(X509_F_X509_CHECK_PRIVATE_KEY,X509_R_KEY_TYPE_MISMATCH);
