ssl/s3_srvr.c:2914: error: NULL_DEREFERENCE
  pointer `pkey` last assigned on line 2870 could be null and is dereferenced at line 2914, column 21.
Showing all 27 steps of the trace


ssl/s3_srvr.c:2848:1: start of procedure ssl3_get_cert_verify()
2846.   }
2847.   
2848. > int ssl3_get_cert_verify(SSL *s)
2849.   {
2850.       EVP_PKEY *pkey = NULL;

ssl/s3_srvr.c:2850:5: 
2848.   int ssl3_get_cert_verify(SSL *s)
2849.   {
2850. >     EVP_PKEY *pkey = NULL;
2851.       unsigned char *p;
2852.       int al, ok, ret = 0;

ssl/s3_srvr.c:2852:5: 
2850.       EVP_PKEY *pkey = NULL;
2851.       unsigned char *p;
2852. >     int al, ok, ret = 0;
2853.       long n;
2854.       int type = 0, i, j;

ssl/s3_srvr.c:2854:5: 
2852.       int al, ok, ret = 0;
2853.       long n;
2854. >     int type = 0, i, j;
2855.       X509 *peer;
2856.       const EVP_MD *md = NULL;

ssl/s3_srvr.c:2856:5: 
2854.       int type = 0, i, j;
2855.       X509 *peer;
2856. >     const EVP_MD *md = NULL;
2857.       EVP_MD_CTX mctx;
2858.       EVP_MD_CTX_init(&mctx);

ssl/s3_srvr.c:2858:5: 
2856.       const EVP_MD *md = NULL;
2857.       EVP_MD_CTX mctx;
2858. >     EVP_MD_CTX_init(&mctx);
2859.   
2860.       n = s->method->ssl_get_message(s,

crypto/evp/digest.c:120:1: start of procedure EVP_MD_CTX_init()
  118.   #endif
  119.   
  120. > void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
  121.   {
  122.       memset(ctx, '\0', sizeof *ctx);

crypto/evp/digest.c:122:5: 
  120.   void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
  121.   {
  122. >     memset(ctx, '\0', sizeof *ctx);
  123.   }
  124.   

crypto/evp/digest.c:123:1: return from a call to EVP_MD_CTX_init
  121.   {
  122.       memset(ctx, '\0', sizeof *ctx);
  123. > }
  124.   
  125.   EVP_MD_CTX *EVP_MD_CTX_create(void)

ssl/s3_srvr.c:2860:5: Skipping __function_pointer__(): unresolved function pointer
2858.       EVP_MD_CTX_init(&mctx);
2859.   
2860.       n = s->method->ssl_get_message(s,
            ^
2861.                                      SSL3_ST_SR_CERT_VRFY_A,
2862.                                      SSL3_ST_SR_CERT_VRFY_B,

ssl/s3_srvr.c:2865:10: Taking false branch
2863.                                      -1, SSL3_RT_MAX_PLAIN_LENGTH, &ok);
2864.   
2865.       if (!ok)
                 ^
2866.           return ((int)n);
2867.   

ssl/s3_srvr.c:2868:9: Taking true branch
2866.           return ((int)n);
2867.   
2868.       if (s->session->peer != NULL) {
                ^
2869.           peer = s->session->peer;
2870.           pkey = X509_get_pubkey(peer);

ssl/s3_srvr.c:2869:9: 
2867.   
2868.       if (s->session->peer != NULL) {
2869. >         peer = s->session->peer;
2870.           pkey = X509_get_pubkey(peer);
2871.           type = X509_certificate_type(peer, pkey);

ssl/s3_srvr.c:2870:9: 
2868.       if (s->session->peer != NULL) {
2869.           peer = s->session->peer;
2870. >         pkey = X509_get_pubkey(peer);
2871.           type = X509_certificate_type(peer, pkey);
2872.       } else {

crypto/x509/x509_cmp.c:306:1: start of procedure X509_get_pubkey()
  304.   }
  305.   
  306. > EVP_PKEY *X509_get_pubkey(X509 *x)
  307.   {
  308.       if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:308:10: Taking false branch
  306.   EVP_PKEY *X509_get_pubkey(X509 *x)
  307.   {
  308.       if ((x == NULL) || (x->cert_info == NULL))
                  ^
  309.           return (NULL);
  310.       return (X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:308:25: Taking true branch
  306.   EVP_PKEY *X509_get_pubkey(X509 *x)
  307.   {
  308.       if ((x == NULL) || (x->cert_info == NULL))
                                 ^
  309.           return (NULL);
  310.       return (X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:309:9: 
  307.   {
  308.       if ((x == NULL) || (x->cert_info == NULL))
  309. >         return (NULL);
  310.       return (X509_PUBKEY_get(x->cert_info->key));
  311.   }

crypto/x509/x509_cmp.c:311:1: return from a call to X509_get_pubkey
  309.           return (NULL);
  310.       return (X509_PUBKEY_get(x->cert_info->key));
  311. > }
  312.   
  313.   ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)

ssl/s3_srvr.c:2871:9: Skipping X509_certificate_type(): empty list of specs
2869.           peer = s->session->peer;
2870.           pkey = X509_get_pubkey(peer);
2871.           type = X509_certificate_type(peer, pkey);
                ^
2872.       } else {
2873.           peer = NULL;

ssl/s3_srvr.c:2877:9: Taking false branch
2875.       }
2876.   
2877.       if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) {
                ^
2878.           s->s3->tmp.reuse_message = 1;
2879.           if (peer != NULL) {

ssl/s3_srvr.c:2888:9: Taking false branch
2886.       }
2887.   
2888.       if (peer == NULL) {
                ^
2889.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_NO_CLIENT_CERT_RECEIVED);
2890.           al = SSL_AD_UNEXPECTED_MESSAGE;

ssl/s3_srvr.c:2894:11: Taking false branch
2892.       }
2893.   
2894.       if (!(type & EVP_PKT_SIGN)) {
                  ^
2895.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,
2896.                  SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE);

ssl/s3_srvr.c:2901:9: Taking false branch
2899.       }
2900.   
2901.       if (s->s3->change_cipher_spec) {
                ^
2902.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_CCS_RECEIVED_EARLY);
2903.           al = SSL_AD_UNEXPECTED_MESSAGE;

ssl/s3_srvr.c:2908:5: 
2906.   
2907.       /* we now have a signature that we need to verify */
2908. >     p = (unsigned char *)s->init_msg;
2909.       /* Check for broken implementations of GOST ciphersuites */
2910.       /*

ssl/s3_srvr.c:2914:9: Taking true branch
2912.        * length field
2913.        */
2914.       if (n == 64 && (pkey->type == NID_id_GostR3410_94 ||
                ^
2915.                       pkey->type == NID_id_GostR3410_2001)) {
2916.           i = 64;

ssl/s3_srvr.c:2914:21: 
2912.        * length field
2913.        */
2914. >     if (n == 64 && (pkey->type == NID_id_GostR3410_94 ||
2915.                       pkey->type == NID_id_GostR3410_2001)) {
2916.           i = 64;
