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


ssl/s3_srvr.c:2894:1: start of procedure ssl3_get_cert_verify()
2892.   }
2893.   
2894. > int ssl3_get_cert_verify(SSL *s)
2895.   {
2896.       EVP_PKEY *pkey = NULL;

ssl/s3_srvr.c:2896:5: 
2894.   int ssl3_get_cert_verify(SSL *s)
2895.   {
2896. >     EVP_PKEY *pkey = NULL;
2897.       unsigned char *p;
2898.       int al, ok, ret = 0;

ssl/s3_srvr.c:2898:5: 
2896.       EVP_PKEY *pkey = NULL;
2897.       unsigned char *p;
2898. >     int al, ok, ret = 0;
2899.       long n;
2900.       int type = 0, i, j;

ssl/s3_srvr.c:2900:5: 
2898.       int al, ok, ret = 0;
2899.       long n;
2900. >     int type = 0, i, j;
2901.       X509 *peer;
2902.       const EVP_MD *md = NULL;

ssl/s3_srvr.c:2902:5: 
2900.       int type = 0, i, j;
2901.       X509 *peer;
2902. >     const EVP_MD *md = NULL;
2903.       EVP_MD_CTX mctx;
2904.       EVP_MD_CTX_init(&mctx);

ssl/s3_srvr.c:2904:5: 
2902.       const EVP_MD *md = NULL;
2903.       EVP_MD_CTX mctx;
2904. >     EVP_MD_CTX_init(&mctx);
2905.   
2906.       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:2906:5: Skipping __function_pointer__(): unresolved function pointer
2904.       EVP_MD_CTX_init(&mctx);
2905.   
2906.       n = s->method->ssl_get_message(s,
            ^
2907.                                      SSL3_ST_SR_CERT_VRFY_A,
2908.                                      SSL3_ST_SR_CERT_VRFY_B,

ssl/s3_srvr.c:2911:10: Taking false branch
2909.                                      -1, SSL3_RT_MAX_PLAIN_LENGTH, &ok);
2910.   
2911.       if (!ok)
                 ^
2912.           return ((int)n);
2913.   

ssl/s3_srvr.c:2914:9: Taking true branch
2912.           return ((int)n);
2913.   
2914.       if (s->session->peer != NULL) {
                ^
2915.           peer = s->session->peer;
2916.           pkey = X509_get_pubkey(peer);

ssl/s3_srvr.c:2915:9: 
2913.   
2914.       if (s->session->peer != NULL) {
2915. >         peer = s->session->peer;
2916.           pkey = X509_get_pubkey(peer);
2917.           type = X509_certificate_type(peer, pkey);

ssl/s3_srvr.c:2916:9: 
2914.       if (s->session->peer != NULL) {
2915.           peer = s->session->peer;
2916. >         pkey = X509_get_pubkey(peer);
2917.           type = X509_certificate_type(peer, pkey);
2918.       } else {

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

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

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

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

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

ssl/s3_srvr.c:2917:9: Skipping X509_certificate_type(): empty list of specs
2915.           peer = s->session->peer;
2916.           pkey = X509_get_pubkey(peer);
2917.           type = X509_certificate_type(peer, pkey);
                ^
2918.       } else {
2919.           peer = NULL;

ssl/s3_srvr.c:2923:9: Taking false branch
2921.       }
2922.   
2923.       if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY) {
                ^
2924.           s->s3->tmp.reuse_message = 1;
2925.           if (peer != NULL) {

ssl/s3_srvr.c:2934:9: Taking false branch
2932.       }
2933.   
2934.       if (peer == NULL) {
                ^
2935.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_NO_CLIENT_CERT_RECEIVED);
2936.           al = SSL_AD_UNEXPECTED_MESSAGE;

ssl/s3_srvr.c:2940:11: Taking false branch
2938.       }
2939.   
2940.       if (!(type & EVP_PKT_SIGN)) {
                  ^
2941.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,
2942.                  SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE);

ssl/s3_srvr.c:2947:9: Taking false branch
2945.       }
2946.   
2947.       if (s->s3->change_cipher_spec) {
                ^
2948.           SSLerr(SSL_F_SSL3_GET_CERT_VERIFY, SSL_R_CCS_RECEIVED_EARLY);
2949.           al = SSL_AD_UNEXPECTED_MESSAGE;

ssl/s3_srvr.c:2954:5: 
2952.   
2953.       /* we now have a signature that we need to verify */
2954. >     p = (unsigned char *)s->init_msg;
2955.       /* Check for broken implementations of GOST ciphersuites */
2956.       /*

ssl/s3_srvr.c:2960:9: Taking true branch
2958.        * length field
2959.        */
2960.       if (n == 64 && (pkey->type == NID_id_GostR3410_94 ||
                ^
2961.                       pkey->type == NID_id_GostR3410_2001)) {
2962.           i = 64;

ssl/s3_srvr.c:2960:21: 
2958.        * length field
2959.        */
2960. >     if (n == 64 && (pkey->type == NID_id_GostR3410_94 ||
2961.                       pkey->type == NID_id_GostR3410_2001)) {
2962.           i = 64;
