crypto/rand/rand_lib.c:343: error: NULL_DEREFERENCE
  pointer `meth` last assigned on line 315 could be null and is dereferenced at line 343, column 13.
Showing all 24 steps of the trace


crypto/rand/rand_lib.c:311:1: start of procedure RAND_poll()
309.    * configurable via the --with-rand-seed configure option.
310.    */
311. > int RAND_poll(void)
312.   {
313.       int ret = 0;

crypto/rand/rand_lib.c:313:5: 
311.   int RAND_poll(void)
312.   {
313. >     int ret = 0;
314.   
315.       const RAND_METHOD *meth = RAND_get_rand_method();

crypto/rand/rand_lib.c:315:5: 
313.       int ret = 0;
314.   
315. >     const RAND_METHOD *meth = RAND_get_rand_method();
316.   
317.       if (meth == RAND_OpenSSL()) {

crypto/rand/rand_lib.c:671:1: start of procedure RAND_get_rand_method()
  669.   #endif
  670.   
  671. > const RAND_METHOD *RAND_get_rand_method(void)
  672.   {
  673.   #ifdef FIPS_MODE

crypto/rand/rand_lib.c:676:5: 
  674.       return NULL;
  675.   #else
  676. >     const RAND_METHOD *tmp_meth = NULL;
  677.   
  678.       if (!RUN_ONCE(&rand_init, do_rand_init))

crypto/rand/rand_lib.c:678:10: 
  676.       const RAND_METHOD *tmp_meth = NULL;
  677.   
  678. >     if (!RUN_ONCE(&rand_init, do_rand_init))
  679.           return NULL;
  680.   

crypto/threads_pthread.c:111:1: start of procedure CRYPTO_THREAD_run_once()
    109.   }
    110.   
    111. > int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
    112.   {
    113.       if (pthread_once(once, init) != 0)

crypto/threads_pthread.c:113:9: Taking true branch
    111.   int CRYPTO_THREAD_run_once(CRYPTO_ONCE *once, void (*init)(void))
    112.   {
    113.       if (pthread_once(once, init) != 0)
                   ^
    114.           return 0;
    115.   

crypto/threads_pthread.c:114:9: 
    112.   {
    113.       if (pthread_once(once, init) != 0)
    114. >         return 0;
    115.   
    116.       return 1;

crypto/threads_pthread.c:117:1: return from a call to CRYPTO_THREAD_run_once
    115.   
    116.       return 1;
    117. > }
    118.   
    119.   int CRYPTO_THREAD_init_local(CRYPTO_THREAD_LOCAL *key, void (*cleanup)(void *))

crypto/rand/rand_lib.c:678:10: Condition is false
  676.       const RAND_METHOD *tmp_meth = NULL;
  677.   
  678.       if (!RUN_ONCE(&rand_init, do_rand_init))
                  ^
  679.           return NULL;
  680.   

crypto/rand/rand_lib.c:678:10: Taking true branch
  676.       const RAND_METHOD *tmp_meth = NULL;
  677.   
  678.       if (!RUN_ONCE(&rand_init, do_rand_init))
                  ^
  679.           return NULL;
  680.   

crypto/rand/rand_lib.c:679:9: 
  677.   
  678.       if (!RUN_ONCE(&rand_init, do_rand_init))
  679. >         return NULL;
  680.   
  681.       CRYPTO_THREAD_write_lock(rand_meth_lock);

crypto/rand/rand_lib.c:703:1: return from a call to RAND_get_rand_method
  701.       return tmp_meth;
  702.   #endif
  703. > }
  704.   
  705.   #if !defined(OPENSSL_NO_ENGINE) && !defined(FIPS_MODE)

crypto/rand/rand_lib.c:317:9: 
315.       const RAND_METHOD *meth = RAND_get_rand_method();
316.   
317. >     if (meth == RAND_OpenSSL()) {
318.           /* fill random pool and seed the master DRBG */
319.           RAND_DRBG *drbg = RAND_DRBG_get0_master();

crypto/rand/drbg_lib.c:1384:1: start of procedure RAND_OpenSSL()
  1382.   };
  1383.   
  1384. > RAND_METHOD *RAND_OpenSSL(void)
  1385.   {
  1386.   #ifndef FIPS_MODE

crypto/rand/drbg_lib.c:1387:5: 
  1385.   {
  1386.   #ifndef FIPS_MODE
  1387. >     return &rand_meth;
  1388.   #else
  1389.       return NULL;

crypto/rand/drbg_lib.c:1391:1: return from a call to RAND_OpenSSL
  1389.       return NULL;
  1390.   #endif
  1391. > }

crypto/rand/rand_lib.c:317:9: Taking false branch
315.       const RAND_METHOD *meth = RAND_get_rand_method();
316.   
317.       if (meth == RAND_OpenSSL()) {
               ^
318.           /* fill random pool and seed the master DRBG */
319.           RAND_DRBG *drbg = RAND_DRBG_get0_master();

crypto/rand/rand_lib.c:331:9: 
329.   
330.       } else {
331. >         RAND_POOL *pool = NULL;
332.   
333.           /* fill random pool and seed the current legacy RNG */

crypto/rand/rand_lib.c:334:9: Skipping rand_pool_new(): empty list of specs
332.   
333.           /* fill random pool and seed the current legacy RNG */
334.           pool = rand_pool_new(RAND_DRBG_STRENGTH,
               ^
335.                                (RAND_DRBG_STRENGTH + 7) / 8,
336.                                RAND_POOL_MAX_LENGTH);

crypto/rand/rand_lib.c:337:13: Taking false branch
335.                                (RAND_DRBG_STRENGTH + 7) / 8,
336.                                RAND_POOL_MAX_LENGTH);
337.           if (pool == NULL)
                   ^
338.               return 0;
339.   

crypto/rand/rand_lib.c:340:13: Taking false branch
338.               return 0;
339.   
340.           if (rand_pool_acquire_entropy(pool) == 0)
                   ^
341.               goto err;
342.   

crypto/rand/rand_lib.c:343:13: 
341.               goto err;
342.   
343. >         if (meth->add == NULL
344.               || meth->add(rand_pool_buffer(pool),
345.                            rand_pool_length(pool),
