crypto/evp/evp_pkey.c:159: error: NULL_DEREFERENCE
  pointer `param` last assigned on line 78 could be null and is dereferenced at line 159, column 7.
Showing all 24 steps of the trace


crypto/evp/evp_pkey.c:69:1: start of procedure EVP_PKCS82PKEY()
67.   /* Extract a private key from a PKCS8 structure */
68.   
69. > EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
70.   {
71.   	EVP_PKEY *pkey = NULL;

crypto/evp/evp_pkey.c:71:2: 
69.   EVP_PKEY *EVP_PKCS82PKEY (PKCS8_PRIV_KEY_INFO *p8)
70.   {
71. > 	EVP_PKEY *pkey = NULL;
72.   #ifndef NO_RSA
73.   	RSA *rsa = NULL;

crypto/evp/evp_pkey.c:73:2: 
71.   	EVP_PKEY *pkey = NULL;
72.   #ifndef NO_RSA
73. > 	RSA *rsa = NULL;
74.   #endif
75.   #ifndef NO_DSA

crypto/evp/evp_pkey.c:76:2: 
74.   #endif
75.   #ifndef NO_DSA
76. > 	DSA *dsa = NULL;
77.   	ASN1_INTEGER *privkey;
78.   	ASN1_TYPE *t1, *t2, *param = NULL;

crypto/evp/evp_pkey.c:78:2: 
76.   	DSA *dsa = NULL;
77.   	ASN1_INTEGER *privkey;
78. > 	ASN1_TYPE *t1, *t2, *param = NULL;
79.   	STACK *ndsa = NULL;
80.   	BN_CTX *ctx = NULL;

crypto/evp/evp_pkey.c:79:2: 
77.   	ASN1_INTEGER *privkey;
78.   	ASN1_TYPE *t1, *t2, *param = NULL;
79. > 	STACK *ndsa = NULL;
80.   	BN_CTX *ctx = NULL;
81.   	int plen;

crypto/evp/evp_pkey.c:80:2: 
78.   	ASN1_TYPE *t1, *t2, *param = NULL;
79.   	STACK *ndsa = NULL;
80. > 	BN_CTX *ctx = NULL;
81.   	int plen;
82.   #endif

crypto/evp/evp_pkey.c:88:5: Taking false branch
86.   	char obj_tmp[80];
87.   
88.   	if(p8->pkey->type == V_ASN1_OCTET_STRING) {
          ^
89.   		p8->broken = PKCS8_OK;
90.   		p = p8->pkey->value.octet_string->data;

crypto/evp/evp_pkey.c:93:3: 
91.   		pkeylen = p8->pkey->value.octet_string->length;
92.   	} else {
93. > 		p8->broken = PKCS8_NO_OCTET;
94.   		p = p8->pkey->value.sequence->data;
95.   		pkeylen = p8->pkey->value.sequence->length;

crypto/evp/evp_pkey.c:94:3: 
92.   	} else {
93.   		p8->broken = PKCS8_NO_OCTET;
94. > 		p = p8->pkey->value.sequence->data;
95.   		pkeylen = p8->pkey->value.sequence->length;
96.   	}

crypto/evp/evp_pkey.c:95:3: 
93.   		p8->broken = PKCS8_NO_OCTET;
94.   		p = p8->pkey->value.sequence->data;
95. > 		pkeylen = p8->pkey->value.sequence->length;
96.   	}
97.   	if (!(pkey = EVP_PKEY_new())) {

crypto/evp/evp_pkey.c:97:8: Taking false branch
95.   		pkeylen = p8->pkey->value.sequence->length;
96.   	}
97.   	if (!(pkey = EVP_PKEY_new())) {
              ^
98.   		EVPerr(EVP_F_EVP_PKCS82PKEY,ERR_R_MALLOC_FAILURE);
99.   		return NULL;

crypto/evp/evp_pkey.c:101:2: 
99.   		return NULL;
100.   	}
101. > 	a = p8->pkeyalg;
102.   	switch (OBJ_obj2nid(a->algorithm))
103.   	{

crypto/evp/evp_pkey.c:102:2: 
100.   	}
101.   	a = p8->pkeyalg;
102. > 	switch (OBJ_obj2nid(a->algorithm))
103.   	{
104.   #ifndef NO_RSA

crypto/objects/obj_dat.c:350:1: start of procedure OBJ_obj2nid()
  348.   	}
  349.   
  350. > int OBJ_obj2nid(ASN1_OBJECT *a)
  351.   	{
  352.   	ASN1_OBJECT **op;

crypto/objects/obj_dat.c:355:6: Taking false branch
  353.   	ADDED_OBJ ad,*adp;
  354.   
  355.   	if (a == NULL)
              ^
  356.   		return(NID_undef);
  357.   	if (a->nid != 0)

crypto/objects/obj_dat.c:357:6: Taking true branch
  355.   	if (a == NULL)
  356.   		return(NID_undef);
  357.   	if (a->nid != 0)
              ^
  358.   		return(a->nid);
  359.   

crypto/objects/obj_dat.c:358:3: 
  356.   		return(NID_undef);
  357.   	if (a->nid != 0)
  358. > 		return(a->nid);
  359.   
  360.   	if (added != NULL)

crypto/objects/obj_dat.c:372:2: return from a call to OBJ_obj2nid
  370.   		return(NID_undef);
  371.   	return((*op)->nid);
  372.   	}
          ^
  373.   
  374.   /* Convert an object name into an ASN1_OBJECT

crypto/evp/evp_pkey.c:105:3: Switch condition is false. Skipping switch case
103.   	{
104.   #ifndef NO_RSA
105.   		case NID_rsaEncryption:
         ^
106.   		if (!(rsa = d2i_RSAPrivateKey (NULL, &p, pkeylen))) {
107.   			EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);

crypto/evp/evp_pkey.c:114:3: Switch condition is true. Entering switch case
112.   #endif
113.   #ifndef NO_DSA
114.   		case NID_dsa:
         ^
115.   		/* PKCS#8 DSA is weird: you just get a private key integer
116.   	         * and parameters in the AlgorithmIdentifier the pubkey must

crypto/evp/evp_pkey.c:121:6: Taking false branch
119.   	
120.   		/* Check for broken DSA PKCS#8, UGH! */
121.   		if(*p == (V_ASN1_SEQUENCE|V_ASN1_CONSTRUCTED)) {
            ^
122.   		    if(!(ndsa = ASN1_seq_unpack(p, pkeylen, 
123.   					(char *(*)())d2i_ASN1_TYPE,

crypto/evp/evp_pkey.c:155:16: Taking false branch
153.   		    }
154.   		    privkey = t2->value.integer;
155.   		} else if (!(privkey=d2i_ASN1_INTEGER (NULL, &p, pkeylen))) {
                      ^
156.   			EVPerr(EVP_F_EVP_PKCS82PKEY, EVP_R_DECODE_ERROR);
157.   			goto dsaerr;

crypto/evp/evp_pkey.c:159:3: 
157.   			goto dsaerr;
158.   		}
159. > 		p = param->value.sequence->data;
160.   		plen = param->value.sequence->length;
161.   		if (!(dsa = d2i_DSAparams (NULL, &p, plen))) {
