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


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

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

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

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

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

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

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

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

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

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