Fixing crash with unknown debug streams.

Closes #643.
This commit is contained in:
Robin Sommer 2011-10-21 10:39:09 -07:00
parent c8dfdb4492
commit 5e5e29f345
4 changed files with 60 additions and 5 deletions

View file

@ -352,6 +352,7 @@ int main(int argc, char** argv)
char* seed_load_file = getenv("BRO_SEED_FILE");
char* seed_save_file = 0;
char* user_pcap_filter = 0;
char* debug_streams = 0;
int bare_mode = false;
int seed = 0;
int dump_cfg = false;
@ -638,9 +639,7 @@ int main(int argc, char** argv)
#endif
case 'B':
#ifdef DEBUG
debug_logger.EnableStreams(optarg);
#endif
debug_streams = optarg;
break;
case 0:
@ -660,6 +659,11 @@ int main(int argc, char** argv)
bro_start_time = current_time(true);
reporter = new Reporter();
#ifdef DEBUG
if ( debug_streams )
debug_logger.EnableStreams(debug_streams);
#endif
init_random_seed(seed, (seed_load_file && *seed_load_file ? seed_load_file : 0) , seed_save_file);
// DEBUG_MSG("HMAC key: %s\n", md5_digest_print(shared_hmac_md5_key));
init_hash_function();