crypto/evp/exchange.c:195: error: NULL_DEREFERENCE
  pointer `null` is dereferenced by call to `EVP_KEYEXCH_fetch()` at line 195, column 24.
Showing all 18 steps of the trace


crypto/evp/exchange.c:168:1: start of procedure EVP_PKEY_derive_init_ex()
166.   }
167.   
168. > int EVP_PKEY_derive_init_ex(EVP_PKEY_CTX *ctx, EVP_KEYEXCH *exchange)
169.   {
170.       int ret;

crypto/evp/exchange.c:171:5: 
169.   {
170.       int ret;
171. >     void *provkey = NULL;
172.   
173.       ctx->operation = EVP_PKEY_OP_DERIVE;

crypto/evp/exchange.c:173:5: 
171.       void *provkey = NULL;
172.   
173. >     ctx->operation = EVP_PKEY_OP_DERIVE;
174.   
175.       if (ctx->engine != NULL)

crypto/evp/exchange.c:175:9: Taking false branch
173.       ctx->operation = EVP_PKEY_OP_DERIVE;
174.   
175.       if (ctx->engine != NULL)
               ^
176.           goto legacy;
177.   

crypto/evp/exchange.c:178:9: Taking false branch
176.           goto legacy;
177.   
178.       if (exchange != NULL) {
               ^
179.           if (!EVP_KEYEXCH_up_ref(exchange))
180.               goto err;

crypto/evp/exchange.c:182:19: Condition is true
180.               goto err;
181.       } else {
182.           int nid = ctx->pkey != NULL ? ctx->pkey->type : ctx->pmeth->pkey_id;
                         ^
183.   
184.           /*

crypto/evp/exchange.c:182:9: 
180.               goto err;
181.       } else {
182. >         int nid = ctx->pkey != NULL ? ctx->pkey->type : ctx->pmeth->pkey_id;
183.   
184.           /*

crypto/evp/exchange.c:188:13: Taking true branch
186.            * algorithms are moved to providers.
187.            */
188.           if (ctx->pkey != NULL) {
                   ^
189.               switch (ctx->pkey->type) {
190.               case EVP_PKEY_DH:

crypto/evp/exchange.c:189:13: 
187.            */
188.           if (ctx->pkey != NULL) {
189. >             switch (ctx->pkey->type) {
190.               case EVP_PKEY_DH:
191.                   break;

crypto/evp/exchange.c:190:13: Switch condition is true. Entering switch case
188.           if (ctx->pkey != NULL) {
189.               switch (ctx->pkey->type) {
190.               case EVP_PKEY_DH:
                   ^
191.                   break;
192.               default:

crypto/evp/exchange.c:195:13: 
193.                   goto legacy;
194.               }
195. >             exchange = EVP_KEYEXCH_fetch(NULL, OBJ_nid2sn(nid), NULL);
196.           } else {
197.               goto legacy;

crypto/objects/obj_dat.c:250:1: start of procedure OBJ_nid2sn()
  248.   }
  249.   
  250. > const char *OBJ_nid2sn(int n)
  251.   {
  252.       ADDED_OBJ ad, *adp;

crypto/objects/obj_dat.c:255:10: Taking true branch
  253.       ASN1_OBJECT ob;
  254.   
  255.       if ((n >= 0) && (n < NUM_NID)) {
                  ^
  256.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
  257.               OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:255:22: Taking true branch
  253.       ASN1_OBJECT ob;
  254.   
  255.       if ((n >= 0) && (n < NUM_NID)) {
                              ^
  256.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
  257.               OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:256:14: Taking true branch
  254.   
  255.       if ((n >= 0) && (n < NUM_NID)) {
  256.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
                      ^
  257.               OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
  258.               return NULL;

crypto/objects/obj_dat.c:256:34: Taking false branch
  254.   
  255.       if ((n >= 0) && (n < NUM_NID)) {
  256.           if ((n != NID_undef) && (nid_objs[n].nid == NID_undef)) {
                                          ^
  257.               OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
  258.               return NULL;

crypto/objects/obj_dat.c:260:9: 
  258.               return NULL;
  259.           }
  260. >         return nid_objs[n].sn;
  261.       }
  262.   

crypto/objects/obj_dat.c:278:1: return from a call to OBJ_nid2sn
  276.       OBJerr(OBJ_F_OBJ_NID2SN, OBJ_R_UNKNOWN_NID);
  277.       return NULL;
  278. > }
  279.   
  280.   const char *OBJ_nid2ln(int n)
