apps/errstr.c:102: error: NULL_DEREFERENCE
  pointer returned by `ERR_get_string_table()` could be null and is dereferenced by call to `lh_stats_bio()` at line 102, column 13.
Showing all 67 steps of the trace


apps/errstr.c:81:1: start of procedure errstr_main()
79.   };
80.   
81. > int errstr_main(int argc, char **argv)
82.   {
83.       OPTION_CHOICE o;

apps/errstr.c:85:5: 
83.       OPTION_CHOICE o;
84.       char buf[256], *prog;
85. >     int ret = 1;
86.       unsigned long l;
87.   

apps/errstr.c:88:5: Skipping opt_init(): empty list of specs
86.       unsigned long l;
87.   
88.       prog = opt_init(argc, argv, errstr_options);
          ^
89.       while ((o = opt_next()) != OPT_EOF) {
90.           switch (o) {

apps/errstr.c:89:12: Loop condition is true. Entering loop body
87.   
88.       prog = opt_init(argc, argv, errstr_options);
89.       while ((o = opt_next()) != OPT_EOF) {
                 ^
90.           switch (o) {
91.           case OPT_EOF:

apps/errstr.c:90:9: 
88.       prog = opt_init(argc, argv, errstr_options);
89.       while ((o = opt_next()) != OPT_EOF) {
90. >         switch (o) {
91.           case OPT_EOF:
92.           case OPT_ERR:

apps/errstr.c:91:9: Switch condition is false. Skipping switch case
89.       while ((o = opt_next()) != OPT_EOF) {
90.           switch (o) {
91.           case OPT_EOF:
              ^
92.           case OPT_ERR:
93.               BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);

apps/errstr.c:92:9: Switch condition is false. Skipping switch case
90.           switch (o) {
91.           case OPT_EOF:
92.           case OPT_ERR:
              ^
93.               BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
94.               goto end;

apps/errstr.c:95:9: Switch condition is false. Skipping switch case
93.               BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
94.               goto end;
95.           case OPT_HELP:
              ^
96.               opt_help(errstr_options);
97.               ret = 0;

apps/errstr.c:99:9: Switch condition is true. Entering switch case
97.               ret = 0;
98.               goto end;
99.           case OPT_STATS:
               ^
100.               lh_ERR_STRING_DATA_node_stats_bio(ERR_get_string_table(),
101.                                                 bio_out);

apps/errstr.c:100:13: Condition is true
98.               goto end;
99.           case OPT_STATS:
100.               lh_ERR_STRING_DATA_node_stats_bio(ERR_get_string_table(),
                   ^
101.                                                 bio_out);
102.               lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(), bio_out);

crypto/err/err.c:796:1: start of procedure ERR_get_string_table()
  794.   }
  795.   
  796. > LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void)
  797.   {
  798.       return get_hash(0, 1);

crypto/err/err.c:798:5: 
  796.   LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void)
  797.   {
  798. >     return get_hash(0, 1);
  799.   }
  800.   

crypto/err/err.c:273:1: start of procedure get_hash()
    271.   static IMPLEMENT_LHASH_COMP_FN(err_string_data, ERR_STRING_DATA)
    272.   
    273. > static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit)
    274.   {
    275.       LHASH_OF(ERR_STRING_DATA) *ret = NULL;

crypto/err/err.c:275:5: 
    273.   static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit)
    274.   {
    275. >     LHASH_OF(ERR_STRING_DATA) *ret = NULL;
    276.   
    277.       if (lockit)

crypto/err/err.c:277:9: Taking true branch
    275.       LHASH_OF(ERR_STRING_DATA) *ret = NULL;
    276.   
    277.       if (lockit)
                   ^
    278.           CRYPTO_w_lock(CRYPTO_LOCK_ERR);
    279.       if (!int_error_hash && create) {

crypto/err/err.c:278:9: 
    276.   
    277.       if (lockit)
    278. >         CRYPTO_w_lock(CRYPTO_LOCK_ERR);
    279.       if (!int_error_hash && create) {
    280.           int_error_hash = lh_ERR_STRING_DATA_new();

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
      412.   }
      413.   
      414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
      415.   {
      416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
      439.       }
      440.   #endif
      441.       if (type < 0) {
                     ^
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking true branch
      450.               CRYPTO_destroy_dynlockid(type);
      451.           }
      452.       } else if (locking_callback != NULL)
                            ^
      453.           locking_callback(mode, type, file, line);
      454.   }

crypto/lock.c:453:9: Skipping __function_pointer__(): unresolved function pointer
      451.           }
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
                     ^
      454.   }
      455.   

crypto/lock.c:441:5: 
      439.       }
      440.   #endif
      441. >     if (type < 0) {
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
      454. > }
      455.   
      456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/err/err.c:279:10: Taking true branch
    277.       if (lockit)
    278.           CRYPTO_w_lock(CRYPTO_LOCK_ERR);
    279.       if (!int_error_hash && create) {
                    ^
    280.           int_error_hash = lh_ERR_STRING_DATA_new();
    281.       }

crypto/err/err.c:279:28: Taking false branch
    277.       if (lockit)
    278.           CRYPTO_w_lock(CRYPTO_LOCK_ERR);
    279.       if (!int_error_hash && create) {
                                      ^
    280.           int_error_hash = lh_ERR_STRING_DATA_new();
    281.       }

crypto/err/err.c:282:9: Taking false branch
    280.           int_error_hash = lh_ERR_STRING_DATA_new();
    281.       }
    282.       if (int_error_hash != NULL)
                   ^
    283.           ret = int_error_hash;
    284.       if (lockit)

crypto/err/err.c:284:9: Taking true branch
    282.       if (int_error_hash != NULL)
    283.           ret = int_error_hash;
    284.       if (lockit)
                   ^
    285.           CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
    286.   

crypto/err/err.c:285:9: 
    283.           ret = int_error_hash;
    284.       if (lockit)
    285. >         CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
    286.   
    287.       return ret;

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
      412.   }
      413.   
      414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
      415.   {
      416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
      439.       }
      440.   #endif
      441.       if (type < 0) {
                     ^
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking true branch
      450.               CRYPTO_destroy_dynlockid(type);
      451.           }
      452.       } else if (locking_callback != NULL)
                            ^
      453.           locking_callback(mode, type, file, line);
      454.   }

crypto/lock.c:453:9: Skipping __function_pointer__(): unresolved function pointer
      451.           }
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
                     ^
      454.   }
      455.   

crypto/lock.c:441:5: 
      439.       }
      440.   #endif
      441. >     if (type < 0) {
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
      454. > }
      455.   
      456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/err/err.c:287:5: 
    285.           CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
    286.   
    287. >     return ret;
    288.   }
    289.   

crypto/err/err.c:288:1: return from a call to get_hash
    286.   
    287.       return ret;
    288. > }
    289.   
    290.   static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *d)

crypto/err/err.c:799:1: return from a call to ERR_get_string_table
  797.   {
  798.       return get_hash(0, 1);
  799. > }
  800.   
  801.   LHASH_OF(ERR_STATE) *ERR_get_err_state_table(void)

apps/errstr.c:100:13: Skipping lh_node_stats_bio(): empty list of specs
98.               goto end;
99.           case OPT_STATS:
100.               lh_ERR_STRING_DATA_node_stats_bio(ERR_get_string_table(),
                   ^
101.                                                 bio_out);
102.               lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(), bio_out);

apps/errstr.c:102:13: Condition is true
100.               lh_ERR_STRING_DATA_node_stats_bio(ERR_get_string_table(),
101.                                                 bio_out);
102.               lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(), bio_out);
                   ^
103.               lh_ERR_STRING_DATA_node_usage_stats_bio(ERR_get_string_table(),
104.                                                       bio_out);

crypto/err/err.c:796:1: start of procedure ERR_get_string_table()
  794.   }
  795.   
  796. > LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void)
  797.   {
  798.       return get_hash(0, 1);

crypto/err/err.c:798:5: 
  796.   LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void)
  797.   {
  798. >     return get_hash(0, 1);
  799.   }
  800.   

crypto/err/err.c:273:1: start of procedure get_hash()
    271.   static IMPLEMENT_LHASH_COMP_FN(err_string_data, ERR_STRING_DATA)
    272.   
    273. > static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit)
    274.   {
    275.       LHASH_OF(ERR_STRING_DATA) *ret = NULL;

crypto/err/err.c:275:5: 
    273.   static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit)
    274.   {
    275. >     LHASH_OF(ERR_STRING_DATA) *ret = NULL;
    276.   
    277.       if (lockit)

crypto/err/err.c:277:9: Taking true branch
    275.       LHASH_OF(ERR_STRING_DATA) *ret = NULL;
    276.   
    277.       if (lockit)
                   ^
    278.           CRYPTO_w_lock(CRYPTO_LOCK_ERR);
    279.       if (!int_error_hash && create) {

crypto/err/err.c:278:9: 
    276.   
    277.       if (lockit)
    278. >         CRYPTO_w_lock(CRYPTO_LOCK_ERR);
    279.       if (!int_error_hash && create) {
    280.           int_error_hash = lh_ERR_STRING_DATA_new();

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
      412.   }
      413.   
      414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
      415.   {
      416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
      439.       }
      440.   #endif
      441.       if (type < 0) {
                     ^
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking true branch
      450.               CRYPTO_destroy_dynlockid(type);
      451.           }
      452.       } else if (locking_callback != NULL)
                            ^
      453.           locking_callback(mode, type, file, line);
      454.   }

crypto/lock.c:453:9: Skipping __function_pointer__(): unresolved function pointer
      451.           }
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
                     ^
      454.   }
      455.   

crypto/lock.c:441:5: 
      439.       }
      440.   #endif
      441. >     if (type < 0) {
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
      454. > }
      455.   
      456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/err/err.c:279:10: Taking true branch
    277.       if (lockit)
    278.           CRYPTO_w_lock(CRYPTO_LOCK_ERR);
    279.       if (!int_error_hash && create) {
                    ^
    280.           int_error_hash = lh_ERR_STRING_DATA_new();
    281.       }

crypto/err/err.c:279:28: Taking false branch
    277.       if (lockit)
    278.           CRYPTO_w_lock(CRYPTO_LOCK_ERR);
    279.       if (!int_error_hash && create) {
                                      ^
    280.           int_error_hash = lh_ERR_STRING_DATA_new();
    281.       }

crypto/err/err.c:282:9: Taking false branch
    280.           int_error_hash = lh_ERR_STRING_DATA_new();
    281.       }
    282.       if (int_error_hash != NULL)
                   ^
    283.           ret = int_error_hash;
    284.       if (lockit)

crypto/err/err.c:284:9: Taking true branch
    282.       if (int_error_hash != NULL)
    283.           ret = int_error_hash;
    284.       if (lockit)
                   ^
    285.           CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
    286.   

crypto/err/err.c:285:9: 
    283.           ret = int_error_hash;
    284.       if (lockit)
    285. >         CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
    286.   
    287.       return ret;

crypto/lock.c:414:1: start of procedure CRYPTO_lock()
      412.   }
      413.   
      414. > void CRYPTO_lock(int mode, int type, const char *file, int line)
      415.   {
      416.   #ifdef LOCK_DEBUG

crypto/lock.c:441:9: Taking false branch
      439.       }
      440.   #endif
      441.       if (type < 0) {
                     ^
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:452:16: Taking true branch
      450.               CRYPTO_destroy_dynlockid(type);
      451.           }
      452.       } else if (locking_callback != NULL)
                            ^
      453.           locking_callback(mode, type, file, line);
      454.   }

crypto/lock.c:453:9: Skipping __function_pointer__(): unresolved function pointer
      451.           }
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
                     ^
      454.   }
      455.   

crypto/lock.c:441:5: 
      439.       }
      440.   #endif
      441. >     if (type < 0) {
      442.           if (dynlock_lock_callback != NULL) {
      443.               struct CRYPTO_dynlock_value *pointer

crypto/lock.c:454:1: return from a call to CRYPTO_lock
      452.       } else if (locking_callback != NULL)
      453.           locking_callback(mode, type, file, line);
      454. > }
      455.   
      456.   int CRYPTO_add_lock(int *pointer, int amount, int type, const char *file,

crypto/err/err.c:287:5: 
    285.           CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
    286.   
    287. >     return ret;
    288.   }
    289.   

crypto/err/err.c:288:1: return from a call to get_hash
    286.   
    287.       return ret;
    288. > }
    289.   
    290.   static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *d)

crypto/err/err.c:799:1: return from a call to ERR_get_string_table
  797.   {
  798.       return get_hash(0, 1);
  799. > }
  800.   
  801.   LHASH_OF(ERR_STATE) *ERR_get_err_state_table(void)

apps/errstr.c:102:13: 
100.               lh_ERR_STRING_DATA_node_stats_bio(ERR_get_string_table(),
101.                                                 bio_out);
102. >             lh_ERR_STRING_DATA_stats_bio(ERR_get_string_table(), bio_out);
103.               lh_ERR_STRING_DATA_node_usage_stats_bio(ERR_get_string_table(),
104.                                                       bio_out);

crypto/lhash/lh_stats.c:113:1: start of procedure lh_stats_bio()
  111.   # endif
  112.   
  113. > void lh_stats_bio(const _LHASH *lh, BIO *out)
  114.   {
  115.       BIO_printf(out, "num_items             = %lu\n", lh->num_items);

crypto/lhash/lh_stats.c:115:5: Skipping BIO_printf(): empty list of specs
  113.   void lh_stats_bio(const _LHASH *lh, BIO *out)
  114.   {
  115.       BIO_printf(out, "num_items             = %lu\n", lh->num_items);
             ^
  116.       BIO_printf(out, "num_nodes             = %u\n", lh->num_nodes);
  117.       BIO_printf(out, "num_alloc_nodes       = %u\n", lh->num_alloc_nodes);
