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


ssl/s3_srvr.c:3046:1: start of procedure ssl3_get_cert_verify()
3044.   	}
3045.   
3046. > int ssl3_get_cert_verify(SSL *s)
3047.   	{
3048.   	EVP_PKEY *pkey=NULL;

ssl/s3_srvr.c:3048:2: 
3046.   int ssl3_get_cert_verify(SSL *s)
3047.   	{
3048. > 	EVP_PKEY *pkey=NULL;
3049.   	unsigned char *p;
3050.   	int al,ok,ret=0;

ssl/s3_srvr.c:3050:2: 
3048.   	EVP_PKEY *pkey=NULL;
3049.   	unsigned char *p;
3050. > 	int al,ok,ret=0;
3051.   	long n;
3052.   	int type=0,i,j;

ssl/s3_srvr.c:3052:2: 
3050.   	int al,ok,ret=0;
3051.   	long n;
3052. > 	int type=0,i,j;
3053.   	X509 *peer;
3054.   	const EVP_MD *md = NULL;

ssl/s3_srvr.c:3054:2: 
3052.   	int type=0,i,j;
3053.   	X509 *peer;
3054. > 	const EVP_MD *md = NULL;
3055.   	EVP_MD_CTX mctx;
3056.   	EVP_MD_CTX_init(&mctx);

ssl/s3_srvr.c:3056:2: 
3054.   	const EVP_MD *md = NULL;
3055.   	EVP_MD_CTX mctx;
3056. > 	EVP_MD_CTX_init(&mctx);
3057.   
3058.   	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:2: 
  120.   void EVP_MD_CTX_init(EVP_MD_CTX *ctx)
  121.   	{
  122. > 	memset(ctx,'\0',sizeof *ctx);
  123.   	}
  124.   

crypto/evp/digest.c:123:2: 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:3058:2: Skipping __function_pointer__(): unresolved function pointer
3056.   	EVP_MD_CTX_init(&mctx);
3057.   
3058.   	n=s->method->ssl_get_message(s,
         ^
3059.   		SSL3_ST_SR_CERT_VRFY_A,
3060.   		SSL3_ST_SR_CERT_VRFY_B,

ssl/s3_srvr.c:3065:7: Taking false branch
3063.   		&ok);
3064.   
3065.   	if (!ok) return((int)n);
              ^
3066.   
3067.   	if (s->session->peer != NULL)

ssl/s3_srvr.c:3067:6: Taking true branch
3065.   	if (!ok) return((int)n);
3066.   
3067.   	if (s->session->peer != NULL)
             ^
3068.   		{
3069.   		peer=s->session->peer;

ssl/s3_srvr.c:3069:3: 
3067.   	if (s->session->peer != NULL)
3068.   		{
3069. > 		peer=s->session->peer;
3070.   		pkey=X509_get_pubkey(peer);
3071.   		type=X509_certificate_type(peer,pkey);

ssl/s3_srvr.c:3070:3: 
3068.   		{
3069.   		peer=s->session->peer;
3070. > 		pkey=X509_get_pubkey(peer);
3071.   		type=X509_certificate_type(peer,pkey);
3072.   		}

crypto/x509/x509_cmp.c:313:1: start of procedure X509_get_pubkey()
  311.   	}
  312.   
  313. > EVP_PKEY *X509_get_pubkey(X509 *x)
  314.   	{
  315.   	if ((x == NULL) || (x->cert_info == NULL))

crypto/x509/x509_cmp.c:315:7: Taking false branch
  313.   EVP_PKEY *X509_get_pubkey(X509 *x)
  314.   	{
  315.   	if ((x == NULL) || (x->cert_info == NULL))
               ^
  316.   		return(NULL);
  317.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:315:22: Taking true branch
  313.   EVP_PKEY *X509_get_pubkey(X509 *x)
  314.   	{
  315.   	if ((x == NULL) || (x->cert_info == NULL))
                              ^
  316.   		return(NULL);
  317.   	return(X509_PUBKEY_get(x->cert_info->key));

crypto/x509/x509_cmp.c:316:3: 
  314.   	{
  315.   	if ((x == NULL) || (x->cert_info == NULL))
  316. > 		return(NULL);
  317.   	return(X509_PUBKEY_get(x->cert_info->key));
  318.   	}

crypto/x509/x509_cmp.c:318:2: return from a call to X509_get_pubkey
  316.   		return(NULL);
  317.   	return(X509_PUBKEY_get(x->cert_info->key));
  318.   	}
          ^
  319.   
  320.   ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x)

ssl/s3_srvr.c:3071:3: Skipping X509_certificate_type(): empty list of specs
3069.   		peer=s->session->peer;
3070.   		pkey=X509_get_pubkey(peer);
3071.   		type=X509_certificate_type(peer,pkey);
          ^
3072.   		}
3073.   	else

ssl/s3_srvr.c:3079:6: Taking false branch
3077.   		}
3078.   
3079.   	if (s->s3->tmp.message_type != SSL3_MT_CERTIFICATE_VERIFY)
             ^
3080.   		{
3081.   		s->s3->tmp.reuse_message=1;

ssl/s3_srvr.c:3092:6: Taking false branch
3090.   		}
3091.   
3092.   	if (peer == NULL)
             ^
3093.   		{
3094.   		SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_NO_CLIENT_CERT_RECEIVED);

ssl/s3_srvr.c:3099:8: Taking false branch
3097.   		}
3098.   
3099.   	if (!(type & EVP_PKT_SIGN))
               ^
3100.   		{
3101.   		SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE);

ssl/s3_srvr.c:3106:6: Taking false branch
3104.   		}
3105.   
3106.   	if (s->s3->change_cipher_spec)
             ^
3107.   		{
3108.   		SSLerr(SSL_F_SSL3_GET_CERT_VERIFY,SSL_R_CCS_RECEIVED_EARLY);

ssl/s3_srvr.c:3114:2: 
3112.   
3113.   	/* we now have a signature that we need to verify */
3114. > 	p=(unsigned char *)s->init_msg;
3115.   	/* Check for broken implementations of GOST ciphersuites */
3116.   	/* If key is GOST and n is exactly 64, it is bare

ssl/s3_srvr.c:3118:6: Taking true branch
3116.   	/* If key is GOST and n is exactly 64, it is bare
3117.   	 * signature without length field */
3118.   	if (n==64 && (pkey->type==NID_id_GostR3410_94 ||
             ^
3119.   		pkey->type == NID_id_GostR3410_2001) )
3120.   		{

ssl/s3_srvr.c:3118:16: 
3116.   	/* If key is GOST and n is exactly 64, it is bare
3117.   	 * signature without length field */
3118. > 	if (n==64 && (pkey->type==NID_id_GostR3410_94 ||
3119.   		pkey->type == NID_id_GostR3410_2001) )
3120.   		{
