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


crypto/x509/x509_req.c:124:1: start of procedure X509_REQ_check_private_key()
122.   }
123.   
124. > int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
125.   {
126.       EVP_PKEY *xk = NULL;

crypto/x509/x509_req.c:126:5: 
124.   int X509_REQ_check_private_key(X509_REQ *x, EVP_PKEY *k)
125.   {
126. >     EVP_PKEY *xk = NULL;
127.       int ok = 0;
128.   

crypto/x509/x509_req.c:127:5: 
125.   {
126.       EVP_PKEY *xk = NULL;
127. >     int ok = 0;
128.   
129.       xk = X509_REQ_get_pubkey(x);

crypto/x509/x509_req.c:129:5: 
127.       int ok = 0;
128.   
129. >     xk = X509_REQ_get_pubkey(x);
130.       switch (EVP_PKEY_cmp(xk, k)) {
131.       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)

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

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

crypto/asn1/x_pubkey.c:175:1: start of procedure X509_PUBKEY_get()
    173.   }
    174.   
    175. > EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
    176.   {
    177.       EVP_PKEY *ret = X509_PUBKEY_get0(key);

crypto/asn1/x_pubkey.c:177:5: 
    175.   EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
    176.   {
    177. >     EVP_PKEY *ret = X509_PUBKEY_get0(key);
    178.       if (ret != NULL)
    179.           EVP_PKEY_up_ref(ret);

crypto/asn1/x_pubkey.c:124:1: start of procedure X509_PUBKEY_get0()
      122.   }
      123.   
      124. > EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
      125.   {
      126.       EVP_PKEY *ret = NULL;

crypto/asn1/x_pubkey.c:126:5: 
      124.   EVP_PKEY *X509_PUBKEY_get0(X509_PUBKEY *key)
      125.   {
      126. >     EVP_PKEY *ret = NULL;
      127.   
      128.       if (key == NULL)

crypto/asn1/x_pubkey.c:128:9: Taking false branch
      126.       EVP_PKEY *ret = NULL;
      127.   
      128.       if (key == NULL)
                     ^
      129.           goto error;
      130.   

crypto/asn1/x_pubkey.c:131:9: Taking false branch
      129.           goto error;
      130.   
      131.       if (key->pkey != NULL)
                     ^
      132.           return key->pkey;
      133.   

crypto/asn1/x_pubkey.c:134:9: Taking true branch
      132.           return key->pkey;
      133.   
      134.       if (key->public_key == NULL)
                     ^
      135.           goto error;
      136.   

crypto/asn1/x_pubkey.c:170:2: 
      168.       return ret;
      169.   
      170. >  error:
      171.       EVP_PKEY_free(ret);
      172.       return (NULL);

crypto/asn1/x_pubkey.c:171:5: 
      169.   
      170.    error:
      171. >     EVP_PKEY_free(ret);
      172.       return (NULL);
      173.   }

crypto/evp/p_lib.c:420:1: start of procedure EVP_PKEY_free()
        418.   }
        419.   
        420. > void EVP_PKEY_free(EVP_PKEY *x)
        421.   {
        422.       int i;

crypto/evp/p_lib.c:424:9: Taking true branch
        422.       int i;
        423.   
        424.       if (x == NULL)
                       ^
        425.           return;
        426.   

crypto/evp/p_lib.c:425:9: 
        423.   
        424.       if (x == NULL)
        425. >         return;
        426.   
        427.       i = CRYPTO_add(&x->references, -1, CRYPTO_LOCK_EVP_PKEY);

crypto/evp/p_lib.c:442:1: return from a call to EVP_PKEY_free
        440.       sk_X509_ATTRIBUTE_pop_free(x->attributes, X509_ATTRIBUTE_free);
        441.       OPENSSL_free(x);
        442. > }
        443.   
        444.   static void EVP_PKEY_free_it(EVP_PKEY *x)

crypto/asn1/x_pubkey.c:172:5: 
      170.    error:
      171.       EVP_PKEY_free(ret);
      172. >     return (NULL);
      173.   }
      174.   

crypto/asn1/x_pubkey.c:173:1: return from a call to X509_PUBKEY_get0
      171.       EVP_PKEY_free(ret);
      172.       return (NULL);
      173. > }
      174.   
      175.   EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)

crypto/asn1/x_pubkey.c:178:9: Taking false branch
    176.   {
    177.       EVP_PKEY *ret = X509_PUBKEY_get0(key);
    178.       if (ret != NULL)
                   ^
    179.           EVP_PKEY_up_ref(ret);
    180.       return ret;

crypto/asn1/x_pubkey.c:180:5: 
    178.       if (ret != NULL)
    179.           EVP_PKEY_up_ref(ret);
    180. >     return ret;
    181.   }
    182.   

crypto/asn1/x_pubkey.c:181:1: return from a call to X509_PUBKEY_get
    179.           EVP_PKEY_up_ref(ret);
    180.       return ret;
    181. > }
    182.   
    183.   /*

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.   X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req)

crypto/x509/x509_req.c:130:5: 
128.   
129.       xk = X509_REQ_get_pubkey(x);
130. >     switch (EVP_PKEY_cmp(xk, k)) {
131.       case 1:
132.           ok = 1;

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

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