Make 0 be a valid packet source timestamp

For fuzzed/damaged/corrupted pcaps, a timestamp of 0 could lead to an
infinite loop in Bro as it interprets that as meaning the packet source
is not ready yet.
This commit is contained in:
Jon Siwek 2018-06-04 13:52:46 -05:00
parent 791b24d232
commit 19b893a5bc
4 changed files with 9 additions and 5 deletions

View file

@ -81,7 +81,7 @@ IOSource* Manager::FindSoonest(double* ts)
all_idle = false;
double local_network_time = 0;
double ts = (*i)->src->NextTimestamp(&local_network_time);
if ( ts > 0 && ts < soonest_ts )
if ( ts >= 0 && ts < soonest_ts )
{
soonest_ts = ts;
soonest_src = (*i)->src;
@ -162,7 +162,7 @@ IOSource* Manager::FindSoonest(double* ts)
{
double local_network_time = 0;
double ts = src->src->NextTimestamp(&local_network_time);
if ( ts > 0.0 && ts < soonest_ts )
if ( ts >= 0.0 && ts < soonest_ts )
{
soonest_ts = ts;
soonest_src = src->src;