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 13.
Showing all 12 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:5: 
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:5: 
118.   {
119.       EVP_PKEY *xk = NULL;
120. >     int ok = 0;
121.   
122.       xk = X509_REQ_get_pubkey(x);

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

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:10: 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:27: Taking true 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:113:9: 
  111.   {
  112.       if ((req == NULL) || (req->req_info == NULL))
  113. >         return (NULL);
  114.       return (X509_PUBKEY_get(req->req_info->pubkey));
  115.   }

crypto/x509/x509_req.c:115:1: 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:5: 
121.   
122.       xk = X509_REQ_get_pubkey(x);
123. >     switch (EVP_PKEY_cmp(xk, k)) {
124.       case 1:
125.           ok = 1;

crypto/evp/p_lib.c:164:1: start of procedure EVP_PKEY_cmp()
  162.   }
  163.   
  164. > int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
  165.   {
  166.       if (a->type != b->type)

crypto/evp/p_lib.c:166:9: 
  164.   int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b)
  165.   {
  166. >     if (a->type != b->type)
  167.           return -1;
  168.   
