ssl/statem/statem_srvr.c:3296: error: NULL_DEREFERENCE
  pointer `pk` last assigned on line 3270 could be null and is dereferenced by call to `EVP_PKEY_CTX_new()` at line 3296, column 16.
Showing all 13 steps of the trace


ssl/statem/statem_srvr.c:3266:1: start of procedure tls_process_cke_gost()
3264.   }
3265.   
3266. > static int tls_process_cke_gost(SSL *s, PACKET *pkt)
3267.   {
3268.   #ifndef OPENSSL_NO_GOST

ssl/statem/statem_srvr.c:3270:5: 
3268.   #ifndef OPENSSL_NO_GOST
3269.       EVP_PKEY_CTX *pkey_ctx;
3270. >     EVP_PKEY *client_pub_pkey = NULL, *pk = NULL;
3271.       unsigned char premaster_secret[32];
3272.       const unsigned char *start;

ssl/statem/statem_srvr.c:3273:5: 
3271.       unsigned char premaster_secret[32];
3272.       const unsigned char *start;
3273. >     size_t outlen = 32, inlen;
3274.       unsigned long alg_a;
3275.       unsigned int asn1id, asn1len;

ssl/statem/statem_srvr.c:3276:5: 
3274.       unsigned long alg_a;
3275.       unsigned int asn1id, asn1len;
3276. >     int ret = 0;
3277.       PACKET encdata;
3278.   

ssl/statem/statem_srvr.c:3280:5: 
3278.   
3279.       /* Get our certificate private key */
3280. >     alg_a = s->s3->tmp.new_cipher->algorithm_auth;
3281.       if (alg_a & SSL_aGOST12) {
3282.           /*

ssl/statem/statem_srvr.c:3281:9: Taking false branch
3279.       /* Get our certificate private key */
3280.       alg_a = s->s3->tmp.new_cipher->algorithm_auth;
3281.       if (alg_a & SSL_aGOST12) {
                ^
3282.           /*
3283.            * New GOST ciphersuites have SSL_aGOST01 bit too

ssl/statem/statem_srvr.c:3292:16: Taking false branch
3290.               pk = s->cert->pkeys[SSL_PKEY_GOST01].privatekey;
3291.           }
3292.       } else if (alg_a & SSL_aGOST01) {
                       ^
3293.           pk = s->cert->pkeys[SSL_PKEY_GOST01].privatekey;
3294.       }

ssl/statem/statem_srvr.c:3296:5: 
3294.       }
3295.   
3296. >     pkey_ctx = EVP_PKEY_CTX_new(pk, NULL);
3297.       if (pkey_ctx == NULL) {
3298.           SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_PROCESS_CKE_GOST,

crypto/evp/pmeth_lib.c:241:1: start of procedure EVP_PKEY_CTX_new()
  239.   }
  240.   
  241. > EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e)
  242.   {
  243.       return int_ctx_new(pkey, e, -1);

crypto/evp/pmeth_lib.c:243:5: 
  241.   EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e)
  242.   {
  243. >     return int_ctx_new(pkey, e, -1);
  244.   }
  245.   

crypto/evp/pmeth_lib.c:103:1: start of procedure int_ctx_new()
    101.   }
    102.   
    103. > static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id)
    104.   {
    105.       EVP_PKEY_CTX *ret;

crypto/evp/pmeth_lib.c:108:9: Taking true branch
    106.       const EVP_PKEY_METHOD *pmeth;
    107.   
    108.       if (id == -1) {
                   ^
    109.           id = pkey->type;
    110.       }

crypto/evp/pmeth_lib.c:109:9: 
    107.   
    108.       if (id == -1) {
    109. >         id = pkey->type;
    110.       }
    111.   #ifndef OPENSSL_NO_ENGINE
