Add checks to avoid improper negative values use.

This commit is contained in:
Jon Siwek 2013-09-17 16:42:48 -05:00
parent a3b963ad4e
commit a316878d01
12 changed files with 89 additions and 62 deletions

View file

@ -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;