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


crypto/x509/x509_req.c:82:1: start of procedure X509_REQ_check_private_key()
80.   }
81.   
82. > int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
83.   {
84.       EVP_PKEY *xk = NULL;

crypto/x509/x509_req.c:84:5: 
82.   int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
83.   {
84. >     EVP_PKEY *xk = NULL;
85.       int ok = 0;
86.   

crypto/x509/x509_req.c:85:5: 
83.   {
84.       EVP_PKEY *xk = NULL;
85. >     int ok = 0;
86.   
87.       xk = X509_REQ_get_pubkey(x);

crypto/x509/x509_req.c:87:5: 
85.       int ok = 0;
86.   
87. >     xk = X509_REQ_get_pubkey(x);
88.       switch (EVP_PKEY_cmp(xk, k)) {
89.       case 1:

crypto/x509/x509_req.c:63:1: start of procedure X509_REQ_get_pubkey()
  61.   }
  62.   
  63. > EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
  64.   {
  65.       if (req == NULL)

crypto/x509/x509_req.c:65:9: Taking false branch
  63.   EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
  64.   {
  65.       if (req == NULL)
                ^
  66.           return NULL;
  67.       return X509_PUBKEY_get(req->req_info.pubkey);

crypto/x509/x509_req.c:67:5: 
  65.       if (req == NULL)
  66.           return NULL;
  67. >     return X509_PUBKEY_get(req->req_info.pubkey);
  68.   }
  69.   

crypto/x509/x_pubkey.c:170:1: start of procedure X509_PUBKEY_get()
    168.   }
    169.   
    170. > EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
    171.   {
    172.       EVP_PKEY *ret = X509_PUBKEY_get0(key);

crypto/x509/x_pubkey.c:172:5: 
    170.   EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
    171.   {
    172. >     EVP_PKEY *ret = X509_PUBKEY_get0(key);
    173.       if (ret != NULL)
    174.           EVP_PKEY_up_ref(ret);

crypto/x509/x_pubkey.c:142:1: start of procedure X509_PUBKEY_get0()
      140.   }
      141.   
      142. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
      143.   {
      144.       EVP_PKEY *ret = NULL;

crypto/x509/x_pubkey.c:144:5: 
      142.   EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
      143.   {
      144. >     EVP_PKEY *ret = NULL;
      145.   
      146.       if (key == NULL || key->public_key == NULL)

crypto/x509/x_pubkey.c:146:9: Taking false branch
      144.       EVP_PKEY *ret = NULL;
      145.   
      146.       if (key == NULL || key->public_key == NULL)
                     ^
      147.           return NULL;
      148.   

crypto/x509/x_pubkey.c:146:24: Taking true branch
      144.       EVP_PKEY *ret = NULL;
      145.   
      146.       if (key == NULL || key->public_key == NULL)
                                    ^
      147.           return NULL;
      148.   

crypto/x509/x_pubkey.c:147:9: 
      145.   
      146.       if (key == NULL || key->public_key == NULL)
      147. >         return NULL;
      148.   
      149.       if (key->pkey != NULL)

crypto/x509/x_pubkey.c:168:1: return from a call to X509_PUBKEY_get0
      166.   
      167.       return NULL;
      168. > }
      169.   
      170.   EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)

crypto/x509/x_pubkey.c:173:9: Taking false branch
    171.   {
    172.       EVP_PKEY *ret = X509_PUBKEY_get0(key);
    173.       if (ret != NULL)
                   ^
    174.           EVP_PKEY_up_ref(ret);
    175.       return ret;

crypto/x509/x_pubkey.c:175:5: 
    173.       if (ret != NULL)
    174.           EVP_PKEY_up_ref(ret);
    175. >     return ret;
    176.   }
    177.   

crypto/x509/x_pubkey.c:176:1: return from a call to X509_PUBKEY_get
    174.           EVP_PKEY_up_ref(ret);
    175.       return ret;
    176. > }
    177.   
    178.   /*

crypto/x509/x509_req.c:68:1: return from a call to X509_REQ_get_pubkey
  66.           return NULL;
  67.       return X509_PUBKEY_get(req->req_info.pubkey);
  68. > }
  69.   
  70.   EVP_PKEY *X509_REQ_get0_pubkey(X509_REQ *req)

crypto/x509/x509_req.c:88:5: 
86.   
87.       xk = X509_REQ_get_pubkey(x);
88. >     switch (EVP_PKEY_cmp(xk, k)) {
89.       case 1:
90.           ok = 1;

crypto/evp/p_lib.c:119:1: start of procedure EVP_PKEY_cmp()
  117.   }
  118.   
  119. > int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
  120.   {
  121.       if (a->type != b->type)

crypto/evp/p_lib.c:121:9: 
  119.   int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
  120.   {
  121. >     if (a->type != b->type)
  122.           return -1;
  123.   
