crypto/ex_data.c:39: error: NULL_DEREFERENCE
  pointer `global` last assigned on line 38 could be null and is dereferenced at line 39, column 9.
Showing all 10 steps of the trace


crypto/ex_data.c:28:1: start of procedure get_and_lock()
26.    * a given class.  On success, *holds the lock.*
27.    */
28. > static EX_CALLBACKS *get_and_lock(OPENSSL_CTX *ctx, int class_index)
29.   {
30.       EX_CALLBACKS *ip;

crypto/ex_data.c:31:5: 
29.   {
30.       EX_CALLBACKS *ip;
31. >     OSSL_EX_DATA_GLOBAL *global = NULL;
32.   
33.       if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {

crypto/ex_data.c:33:9: Taking false branch
31.       OSSL_EX_DATA_GLOBAL *global = NULL;
32.   
33.       if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
              ^
34.           CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_PASSED_INVALID_ARGUMENT);
35.           return NULL;

crypto/ex_data.c:33:28: Taking false branch
31.       OSSL_EX_DATA_GLOBAL *global = NULL;
32.   
33.       if (class_index < 0 || class_index >= CRYPTO_EX_INDEX__COUNT) {
                                 ^
34.           CRYPTOerr(CRYPTO_F_GET_AND_LOCK, ERR_R_PASSED_INVALID_ARGUMENT);
35.           return NULL;

crypto/ex_data.c:38:5: 
36.       }
37.   
38. >     global = openssl_ctx_get_ex_data_global(ctx);
39.       if (global->ex_data_lock == NULL) {
40.           /*

crypto/context.c:211:1: start of procedure openssl_ctx_get_ex_data_global()
  209.   }
  210.   
  211. > OSSL_EX_DATA_GLOBAL *openssl_ctx_get_ex_data_global(OPENSSL_CTX *ctx)
  212.   {
  213.       /*

crypto/context.c:225:9: Taking true branch
  223.       }
  224.   #endif
  225.       if (ctx == NULL)
                 ^
  226.           return NULL;
  227.       return &ctx->global;

crypto/context.c:226:9: 
  224.   #endif
  225.       if (ctx == NULL)
  226. >         return NULL;
  227.       return &ctx->global;
  228.   }

crypto/context.c:228:1: return from a call to openssl_ctx_get_ex_data_global
  226.           return NULL;
  227.       return &ctx->global;
  228. > }
  229.   
  230.   int openssl_ctx_run_once(OPENSSL_CTX *ctx, unsigned int idx,

crypto/ex_data.c:39:9: 
37.   
38.       global = openssl_ctx_get_ex_data_global(ctx);
39. >     if (global->ex_data_lock == NULL) {
40.           /*
41.            * This can happen in normal operation when using CRYPTO_mem_leaks().
