mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Add checks to avoid improper negative values use.
This commit is contained in:
parent
a3b963ad4e
commit
a316878d01
12 changed files with 89 additions and 62 deletions
|
@ -20,13 +20,8 @@ DataEvent::DataEvent(RecordVal* args, File* file,
|
|||
|
||||
file_analysis::Analyzer* DataEvent::Instantiate(RecordVal* args, File* file)
|
||||
{
|
||||
using BifType::Record::Files::AnalyzerArgs;
|
||||
|
||||
int chunk_off = AnalyzerArgs->FieldOffset("chunk_event");
|
||||
int stream_off = AnalyzerArgs->FieldOffset("stream_event");
|
||||
|
||||
Val* chunk_val = args->Lookup(chunk_off);
|
||||
Val* stream_val = args->Lookup(stream_off);
|
||||
Val* chunk_val = args->Lookup("chunk_event");
|
||||
Val* stream_val = args->Lookup("stream_event");
|
||||
|
||||
if ( ! chunk_val && ! stream_val ) return 0;
|
||||
|
||||
|
|
|
@ -33,8 +33,7 @@ Extract::~Extract()
|
|||
|
||||
static Val* get_extract_field_val(RecordVal* args, const char* name)
|
||||
{
|
||||
using BifType::Record::Files::AnalyzerArgs;
|
||||
Val* rval = args->Lookup(AnalyzerArgs->FieldOffset(name));
|
||||
Val* rval = args->Lookup(name);
|
||||
|
||||
if ( ! rval )
|
||||
reporter->Error("File extraction analyzer missing arg field: %s", name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue