mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
Fixing bug causing crash when running without arguments.
This commit is contained in:
parent
97b5f812c7
commit
084c2086a4
3 changed files with 8 additions and 2 deletions
|
@ -527,6 +527,7 @@ static int load_files_with_prefix(const char* orig_file)
|
|||
|
||||
const char* full_filename = "<internal error>";
|
||||
const char* bropath_subpath = "<internal error>";
|
||||
const char* bropath_subpath_delete = 0;
|
||||
FILE* f;
|
||||
|
||||
if ( streq(orig_file, "-") )
|
||||
|
@ -552,6 +553,7 @@ static int load_files_with_prefix(const char* orig_file)
|
|||
strcpy(new_filename, orig_file);
|
||||
|
||||
f = search_for_file(new_filename, "bro", &full_filename, true, &bropath_subpath);
|
||||
bropath_subpath_delete = bropath_subpath; // This will be deleted.
|
||||
delete [] new_filename;
|
||||
}
|
||||
|
||||
|
@ -566,7 +568,7 @@ static int load_files_with_prefix(const char* orig_file)
|
|||
{
|
||||
fclose(f);
|
||||
delete [] full_filename;
|
||||
delete [] bropath_subpath;
|
||||
delete [] bropath_subpath_delete;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -617,7 +619,7 @@ static int load_files_with_prefix(const char* orig_file)
|
|||
docs_generated.push_back(current_reST_doc);
|
||||
}
|
||||
|
||||
delete [] bropath_subpath;
|
||||
delete [] bropath_subpath_delete;
|
||||
|
||||
// "orig_file", could be an alias for yytext, which is ephemeral
|
||||
// and will be zapped after the yy_switch_to_buffer() below.
|
||||
|
|
0
testing/btest/Baseline/core.nop/output
Normal file
0
testing/btest/Baseline/core.nop/output
Normal file
4
testing/btest/core/nop.bro
Normal file
4
testing/btest/core/nop.bro
Normal file
|
@ -0,0 +1,4 @@
|
|||
# Bro shouldn't crash when doing nothing, nor outputting anything.
|
||||
#
|
||||
# @TEST-EXEC: cat /dev/null | bro >output 2>&1
|
||||
# @TEST-EXEC: btest-diff output
|
Loading…
Add table
Add a link
Reference in a new issue