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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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