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


crypto/x509/x509_req.c:119:1: start of procedure X509_REQ_check_private_key()
117.   }
118.   
119. > int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
120.   {
121.       EVP_PKEY *xk = NULL;

crypto/x509/x509_req.c:121:5: 
119.   int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
120.   {
121. >     EVP_PKEY *xk = NULL;
122.       int ok = 0;
123.   

crypto/x509/x509_req.c:122:5: 
120.   {
121.       EVP_PKEY *xk = NULL;
122. >     int ok = 0;
123.   
124.       xk = X509_REQ_get_pubkey(x);

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

crypto/x509/x509_req.c:112:1: start of procedure X509_REQ_get_pubkey()
  110.   }
  111.   
  112. > EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
  113.   {
  114.       if ((req == NULL) || (req->req_info == NULL))

crypto/x509/x509_req.c:114:10: Taking false branch
  112.   EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
  113.   {
  114.       if ((req == NULL) || (req->req_info == NULL))
                  ^
  115.           return (NULL);
  116.       return (X509_PUBKEY_get(req->req_info->pubkey));

crypto/x509/x509_req.c:114:27: Taking true branch
  112.   EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
  113.   {
  114.       if ((req == NULL) || (req->req_info == NULL))
                                   ^
  115.           return (NULL);
  116.       return (X509_PUBKEY_get(req->req_info->pubkey));

crypto/x509/x509_req.c:115:9: 
  113.   {
  114.       if ((req == NULL) || (req->req_info == NULL))
  115. >         return (NULL);
  116.       return (X509_PUBKEY_get(req->req_info->pubkey));
  117.   }

crypto/x509/x509_req.c:117:1: return from a call to X509_REQ_get_pubkey
  115.           return (NULL);
  116.       return (X509_PUBKEY_get(req->req_info->pubkey));
  117. > }
  118.   
  119.   int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)

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