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


crypto/x509/x509_cmp.c:371:1: start of procedure X509_check_private_key()
369.   	}
370.   
371. > int X509_check_private_key(X509 *x, EVP_PKEY *k)
372.   	{
373.   	EVP_PKEY *xk=NULL;

crypto/x509/x509_cmp.c:373:2: 
371.   int X509_check_private_key(X509 *x, EVP_PKEY *k)
372.   	{
373. > 	EVP_PKEY *xk=NULL;
374.   	int ok=0;
375.   

crypto/x509/x509_cmp.c:374:2: 
372.   	{
373.   	EVP_PKEY *xk=NULL;
374. > 	int ok=0;
375.   
376.   	xk=X509_get_pubkey(x);

crypto/x509/x509_cmp.c:376:2: 
374.   	int ok=0;
375.   
376. > 	xk=X509_get_pubkey(x);
377.   	if (xk->type != k->type)
378.   	    {

crypto/x509/x509_cmp.c:358:1: start of procedure X509_get_pubkey()
  356.   	}
  357.   
  358. > EVP_PKEY *X509_get_pubkey(X509 *x)
  359.   	{
  360.   	if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:360:7: Taking false branch
  358.   EVP_PKEY *X509_get_pubkey(X509 *x)
  359.   	{
  360.   	if ((x == NULL) || (x->cert_info == NULL))
               ^
  361.   		return(NULL);
  362.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:360:22: Taking true branch
  358.   EVP_PKEY *X509_get_pubkey(X509 *x)
  359.   	{
  360.   	if ((x == NULL) || (x->cert_info == NULL))
                              ^
  361.   		return(NULL);
  362.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:361:3: 
  359.   	{
  360.   	if ((x == NULL) || (x->cert_info == NULL))
  361. > 		return(NULL);
  362.   	return(X509_PUBKEY_get(x->cert_info->key));
  363.   	}

crypto/x509/x509_cmp.c:363:2: return from a call to X509_get_pubkey
  361.   		return(NULL);
  362.   	return(X509_PUBKEY_get(x->cert_info->key));
  363.   	}
          ^
  364.   
  365.   ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)

crypto/x509/x509_cmp.c:377:6: 
375.   
376.   	xk=X509_get_pubkey(x);
377. > 	if (xk->type != k->type)
378.   	    {
379.   	    X509err(X509_F_X509_CHECK_PRIVATE_KEY,X509_R_KEY_TYPE_MISMATCH);
