crypto/evp/evp_fetch.c:404: error: NULL_DEREFERENCE
  pointer `namemap` last assigned on line 402 could be null and is dereferenced by call to `ossl_namemap_doall_names()` at line 404, column 5.
Showing all 20 steps of the trace


crypto/evp/evp_fetch.c:397:1: start of procedure evp_doall_names()
395.   }
396.   
397. > void evp_doall_names(OSSL_PROVIDER *prov, int number,
398.                        void (*fn)(const char *name, void *data),
399.                        void *data)

crypto/evp/evp_fetch.c:401:5: 
399.                        void *data)
400.   {
401. >     OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
402.       OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
403.   

crypto/provider_core.c:710:1: start of procedure ossl_provider_library_context()
  708.   }
  709.   
  710. > OPENSSL_CTX *ossl_provider_library_context(const OSSL_PROVIDER *prov)
  711.   {
  712.       /* TODO(3.0) just: return prov->libctx; */

crypto/provider_core.c:713:12: Condition is true
  711.   {
  712.       /* TODO(3.0) just: return prov->libctx; */
  713.       return prov != NULL ? prov->libctx : NULL;
                    ^
  714.   }
  715.   

crypto/provider_core.c:713:5: 
  711.   {
  712.       /* TODO(3.0) just: return prov->libctx; */
  713. >     return prov != NULL ? prov->libctx : NULL;
  714.   }
  715.   

crypto/provider_core.c:714:1: return from a call to ossl_provider_library_context
  712.       /* TODO(3.0) just: return prov->libctx; */
  713.       return prov != NULL ? prov->libctx : NULL;
  714. > }
  715.   
  716.   /* Wrappers around calls to the provider */

crypto/evp/evp_fetch.c:402:5: 
400.   {
401.       OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
402. >     OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
403.   
404.       ossl_namemap_doall_names(namemap, number, fn, data);

crypto/core_namemap.c:90:1: start of procedure ossl_namemap_stored()
  88.    */
  89.   
  90. > OSSL_NAMEMAP *ossl_namemap_stored(OPENSSL_CTX *libctx)
  91.   {
  92.       return openssl_ctx_get_data(libctx, OPENSSL_CTX_NAMEMAP_INDEX,

crypto/core_namemap.c:92:5: 
  90.   OSSL_NAMEMAP *ossl_namemap_stored(OPENSSL_CTX *libctx)
  91.   {
  92. >     return openssl_ctx_get_data(libctx, OPENSSL_CTX_NAMEMAP_INDEX,
  93.                                   &stored_namemap_method);
  94.   }

crypto/context.c:207:1: start of procedure openssl_ctx_get_data()
    205.   }
    206.   
    207. > void *openssl_ctx_get_data(OPENSSL_CTX *ctx, int index,
    208.                              const OPENSSL_CTX_METHOD *meth)
    209.   {

crypto/context.c:210:5: 
    208.                              const OPENSSL_CTX_METHOD *meth)
    209.   {
    210. >     void *data = NULL;
    211.       int dynidx;
    212.   

crypto/context.c:213:5: 
    211.       int dynidx;
    212.   
    213. >     ctx = openssl_ctx_get_concrete(ctx);
    214.       if (ctx == NULL)
    215.           return NULL;

crypto/context.c:155:1: start of procedure openssl_ctx_get_concrete()
      153.   }
      154.   
      155. > OPENSSL_CTX *openssl_ctx_get_concrete(OPENSSL_CTX *ctx)
      156.   {
      157.   #ifndef FIPS_MODE

crypto/context.c:164:5: 
      162.       }
      163.   #endif
      164. >     return ctx;
      165.   }
      166.   

crypto/context.c:165:1: return from a call to openssl_ctx_get_concrete
      163.   #endif
      164.       return ctx;
      165. > }
      166.   
      167.   static void openssl_ctx_generic_new(void *parent_ign, void *ptr_ign,

crypto/context.c:214:9: Taking true branch
    212.   
    213.       ctx = openssl_ctx_get_concrete(ctx);
    214.       if (ctx == NULL)
                   ^
    215.           return NULL;
    216.   

crypto/context.c:215:9: 
    213.       ctx = openssl_ctx_get_concrete(ctx);
    214.       if (ctx == NULL)
    215. >         return NULL;
    216.   
    217.       CRYPTO_THREAD_read_lock(ctx->lock);

crypto/context.c:255:1: return from a call to openssl_ctx_get_data
    253.   
    254.       return data;
    255. > }
    256.   
    257.   OSSL_EX_DATA_GLOBAL *openssl_ctx_get_ex_data_global(OPENSSL_CTX *ctx)

crypto/core_namemap.c:94:1: return from a call to ossl_namemap_stored
  92.       return openssl_ctx_get_data(libctx, OPENSSL_CTX_NAMEMAP_INDEX,
  93.                                   &stored_namemap_method);
  94. > }
  95.   
  96.   OSSL_NAMEMAP *ossl_namemap_new(void)

crypto/evp/evp_fetch.c:404:5: 
402.       OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
403.   
404. >     ossl_namemap_doall_names(namemap, number, fn, data);
405.   }

void evp_doall_names(OSSL_PROVIDER *prov, int number,
                     void (*fn)(const char *name, void *data),
                     void *data)
{
    OPENSSL_CTX *libctx = ossl_provider_library_context(prov);
    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);
    ossl_namemap_doall_names(namemap, number, fn, data);
}
['void evp_doall_names(OSSL_PROVIDER *prov, int number,\n                     void (*fn)(const char *name, void *data),\n                     void *data)\n{\n    OPENSSL_CTX *libctx = ossl_provider_library_context(prov);\n    OSSL_NAMEMAP *namemap = ossl_namemap_stored(libctx);\n    ossl_namemap_doall_names(namemap, number, fn, data);\n}', 'OPENSSL_CTX *ossl_provider_library_context(const OSSL_PROVIDER *prov)\n{\n    return prov != NULL ? prov->libctx : NULL;\n}', 'OSSL_NAMEMAP *ossl_namemap_stored(OPENSSL_CTX *libctx)\n{\n    return openssl_ctx_get_data(libctx, OPENSSL_CTX_NAMEMAP_INDEX,\n                                &stored_namemap_method);\n}', 'void *openssl_ctx_get_data(OPENSSL_CTX *ctx, int index,\n                           const OPENSSL_CTX_METHOD *meth)\n{\n    void *data = NULL;\n    int dynidx;\n    ctx = openssl_ctx_get_concrete(ctx);\n    if (ctx == NULL)\n        return NULL;\n    CRYPTO_THREAD_read_lock(ctx->lock);\n    dynidx = ctx->dyn_indexes[index];\n    CRYPTO_THREAD_unlock(ctx->lock);\n    if (dynidx != -1) {\n        CRYPTO_THREAD_read_lock(ctx->index_locks[index]);\n        data = CRYPTO_get_ex_data(&ctx->data, dynidx);\n        CRYPTO_THREAD_unlock(ctx->index_locks[index]);\n        return data;\n    }\n    CRYPTO_THREAD_write_lock(ctx->index_locks[index]);\n    CRYPTO_THREAD_write_lock(ctx->lock);\n    dynidx = ctx->dyn_indexes[index];\n    if (dynidx != -1) {\n        CRYPTO_THREAD_unlock(ctx->lock);\n        data = CRYPTO_get_ex_data(&ctx->data, dynidx);\n        CRYPTO_THREAD_unlock(ctx->index_locks[index]);\n        return data;\n    }\n    if (!openssl_ctx_init_index(ctx, index, meth)) {\n        CRYPTO_THREAD_unlock(ctx->lock);\n        CRYPTO_THREAD_unlock(ctx->index_locks[index]);\n        return NULL;\n    }\n    CRYPTO_THREAD_unlock(ctx->lock);\n    if (CRYPTO_alloc_ex_data(CRYPTO_EX_INDEX_OPENSSL_CTX, NULL,\n                             &ctx->data, ctx->dyn_indexes[index]))\n        data = CRYPTO_get_ex_data(&ctx->data, ctx->dyn_indexes[index]);\n    CRYPTO_THREAD_unlock(ctx->index_locks[index]);\n    return data;\n}', 'OPENSSL_CTX *openssl_ctx_get_concrete(OPENSSL_CTX *ctx)\n{\n#ifndef FIPS_MODE\n    if (ctx == NULL) {\n        if (!RUN_ONCE(&default_context_init, do_default_context_init))\n            return 0;\n        return default_context;\n    }\n#endif\n    return ctx;\n}']