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


crypto/initthread.c:309:1: start of procedure ossl_init_thread_start()
307.   }
308.   
309. > int ossl_init_thread_start(const void *index, void *arg,
310.                              OSSL_thread_stop_handler_fn handfn)
311.   {

crypto/initthread.c:315:5: 
313.       THREAD_EVENT_HANDLER *hand;
314.   #ifdef FIPS_MODE
315. >     OPENSSL_CTX *ctx = arg;
316.   
317.       /*

crypto/initthread.c:322:5: 
320.        * gets informed about thread stop events individually.
321.        */
322. >     CRYPTO_THREAD_LOCAL *local
323.           = openssl_ctx_get_data(ctx, OPENSSL_CTX_THREAD_EVENT_HANDLER_INDEX,
324.                                  &thread_event_ossl_ctx_method);

crypto/context.c:186:1: start of procedure openssl_ctx_get_data()
  184.   }
  185.   
  186. > void *openssl_ctx_get_data(OPENSSL_CTX *ctx, int index,
  187.                              const OPENSSL_CTX_METHOD *meth)
  188.   {

crypto/context.c:189:5: 
  187.                              const OPENSSL_CTX_METHOD *meth)
  188.   {
  189. >     void *data = NULL;
  190.   
  191.       ctx = openssl_ctx_get_concrete(ctx);

crypto/context.c:191:5: 
  189.       void *data = NULL;
  190.   
  191. >     ctx = openssl_ctx_get_concrete(ctx);
  192.       if (ctx == NULL)
  193.           return NULL;

crypto/context.c:134:1: start of procedure openssl_ctx_get_concrete()
    132.   }
    133.   
    134. > OPENSSL_CTX *openssl_ctx_get_concrete(OPENSSL_CTX *ctx)
    135.   {
    136.   #ifndef FIPS_MODE

crypto/context.c:143:5: 
    141.       }
    142.   #endif
    143. >     return ctx;
    144.   }
    145.   

crypto/context.c:144:1: return from a call to openssl_ctx_get_concrete
    142.   #endif
    143.       return ctx;
    144. > }
    145.   
    146.   static void openssl_ctx_generic_new(void *parent_ign, void *ptr_ign,

crypto/context.c:192:9: Taking true branch
  190.   
  191.       ctx = openssl_ctx_get_concrete(ctx);
  192.       if (ctx == NULL)
                 ^
  193.           return NULL;
  194.   

crypto/context.c:193:9: 
  191.       ctx = openssl_ctx_get_concrete(ctx);
  192.       if (ctx == NULL)
  193. >         return NULL;
  194.   
  195.       CRYPTO_THREAD_read_lock(ctx->lock);

crypto/context.c:211:1: return from a call to openssl_ctx_get_data
  209.   
  210.       return data;
  211. > }
  212.   
  213.   OSSL_EX_DATA_GLOBAL *openssl_ctx_get_ex_data_global(OPENSSL_CTX *ctx)

crypto/initthread.c:335:5: 
333.   #endif
334.   
335. >     hands = init_get_thread_local(local, 1, 0);
336.       if (hands == NULL)
337.           return 0;

crypto/initthread.c:82:1: start of procedure init_get_thread_local()
  80.   static void init_thread_stop(void *arg, THREAD_EVENT_HANDLER **hands);
  81.   
  82. > static THREAD_EVENT_HANDLER **
  83.   init_get_thread_local(CRYPTO_THREAD_LOCAL *local, int alloc, int keep)
  84.   {

crypto/initthread.c:85:5: 
  83.   init_get_thread_local(CRYPTO_THREAD_LOCAL *local, int alloc, int keep)
  84.   {
  85. >     THREAD_EVENT_HANDLER **hands = CRYPTO_THREAD_get_local(local);
  86.   
  87.       if (alloc) {

crypto/threads_pthread.c:127:1: start of procedure CRYPTO_THREAD_get_local()
    125.   }
    126.   
    127. > void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
    128.   {
    129.       return pthread_getspecific(*key);

crypto/threads_pthread.c:129:5: Skipping pthread_getspecific(): method has no implementation
    127.   void *CRYPTO_THREAD_get_local(CRYPTO_THREAD_LOCAL *key)
    128.   {
    129.       return pthread_getspecific(*key);
               ^
    130.   }
    131.   
