test/drbgtest.c:160: error: NULL_DEREFERENCE
  pointer `t` last assigned on line 158 could be null and is dereferenced at line 160, column 5.
Showing all 10 steps of the trace


test/drbgtest.c:155:1: start of procedure kat_nonce()
153.   }
154.   
155. > static size_t kat_nonce(RAND_DRBG *drbg, unsigned char **pout,
156.                           int entropy, size_t min_len, size_t max_len)
157.   {

test/drbgtest.c:158:5: 
156.                           int entropy, size_t min_len, size_t max_len)
157.   {
158. >     TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index);
159.   
160.       t->noncecnt++;

crypto/rand/drbg_lib.c:1108:1: start of procedure RAND_DRBG_get_ex_data()
  1106.   }
  1107.   
  1108. > void *RAND_DRBG_get_ex_data(const RAND_DRBG *drbg, int idx)
  1109.   {
  1110.       return CRYPTO_get_ex_data(&drbg->ex_data, idx);

crypto/rand/drbg_lib.c:1110:5: 
  1108.   void *RAND_DRBG_get_ex_data(const RAND_DRBG *drbg, int idx)
  1109.   {
  1110. >     return CRYPTO_get_ex_data(&drbg->ex_data, idx);
  1111.   }
  1112.   

crypto/ex_data.c:458:1: start of procedure CRYPTO_get_ex_data()
    456.    * particular index in the class used by this variable
    457.    */
    458. > void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    459.   {
    460.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))

crypto/ex_data.c:460:9: Taking true branch
    458.   void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx)
    459.   {
    460.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
                   ^
    461.           return NULL;
    462.       return sk_void_value(ad->sk, idx);

crypto/ex_data.c:461:9: 
    459.   {
    460.       if (ad->sk == NULL || idx >= sk_void_num(ad->sk))
    461. >         return NULL;
    462.       return sk_void_value(ad->sk, idx);
    463.   }

crypto/ex_data.c:463:1: return from a call to CRYPTO_get_ex_data
    461.           return NULL;
    462.       return sk_void_value(ad->sk, idx);
    463. > }
    464.   
    465.   OPENSSL_CTX *crypto_ex_data_get_openssl_ctx(const CRYPTO_EX_DATA *ad)

crypto/rand/drbg_lib.c:1111:1: return from a call to RAND_DRBG_get_ex_data
  1109.   {
  1110.       return CRYPTO_get_ex_data(&drbg->ex_data, idx);
  1111. > }
  1112.   
  1113.   

test/drbgtest.c:160:5: 
158.       TEST_CTX *t = (TEST_CTX *)RAND_DRBG_get_ex_data(drbg, app_data_index);
159.   
160. >     t->noncecnt++;
161.       *pout = (unsigned char *)t->nonce;
162.       return t->noncelen;
