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


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

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

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

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

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

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

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

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

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

ssl/s3_srvr.c:2918:9: 
2916.       if (s->session->peer != NULL) {
2917.           peer = s->session->peer;
2918. >         pkey = X509_get_pubkey(peer);
2919.           type = X509_certificate_type(peer, pkey);
2920.       } 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:2919:9: Skipping X509_certificate_type(): empty list of specs
2917.           peer = s->session->peer;
2918.           pkey = X509_get_pubkey(peer);
2919.           type = X509_certificate_type(peer, pkey);
                ^
2920.       } else {
2921.           peer = NULL;

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

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

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

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

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

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

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