crypto/initthread.c:347: error: NULL_DEREFERENCE
  pointer `local` last assigned on line 334 could be null and is dereferenced by call to `init_get_thread_local()` at line 347, column 13.
Showing all 17 steps of the trace


crypto/initthread.c:321:1: start of procedure ossl_init_thread_start()
319.   }
320.   
321. > int ossl_init_thread_start(const void *index, void *arg,
322.                              OSSL_thread_stop_handler_fn handfn)
323.   {

crypto/initthread.c:327:5: 
325.       THREAD_EVENT_HANDLER *hand;
326.   #ifdef FIPS_MODE
327. >     OPENSSL_CTX *ctx = arg;
328.   
329.       /*

crypto/initthread.c:334:5: 
332.        * gets informed about thread stop events individually.
333.        */
334. >     CRYPTO_THREAD_LOCAL *local
335.           = openssl_ctx_get_data(ctx, OPENSSL_CTX_THREAD_EVENT_HANDLER_INDEX,
336.                                  &thread_event_ossl_ctx_method);

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/initthread.c:347:5: 
345.   #endif
346.   
347. >     hands = init_get_thread_local(local, 1, 0);
348.       if (hands == NULL)
349.           return 0;

crypto/initthread.c:88:1: start of procedure init_get_thread_local()
  86.   static void init_thread_stop(void *arg, THREAD_EVENT_HANDLER **hands);
  87.   
  88. > static THREAD_EVENT_HANDLER **
  89.   init_get_thread_local(CRYPTO_THREAD_LOCAL *local, int alloc, int keep)
  90.   {

crypto/initthread.c:91:5: 
  89.   init_get_thread_local(CRYPTO_THREAD_LOCAL *local, int alloc, int keep)
  90.   {
  91. >     THREAD_EVENT_HANDLER **hands = CRYPTO_THREAD_get_local(local);
  92.   
  93.       if (alloc) {

crypto/threads_pthread.c:131:1: start of procedure CRYPTO_THREAD_get_local()
    129.   }
    130.   
    131. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
    132.   {
    133.       return pthread_getspecific(*key);

crypto/threads_pthread.c:133:5: Skipping pthread_getspecific(): method has no implementation
    131.   void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
    132.   {
    133.       return pthread_getspecific(*key);
               ^
    134.   }
    135.   
