mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Fix potential null-dereference in current_time()
This commit is contained in:
parent
7efc39d228
commit
965a99a781
1 changed files with 2 additions and 4 deletions
|
@ -1507,13 +1507,11 @@ double current_time(bool real)
|
|||
|
||||
double t = double(tv.tv_sec) + double(tv.tv_usec) / 1e6;
|
||||
|
||||
const iosource::Manager::PktSrcList& pkt_srcs(iosource_mgr->GetPktSrcs());
|
||||
|
||||
if ( ! pseudo_realtime || real || pkt_srcs.empty() )
|
||||
if ( ! pseudo_realtime || real || ! iosource_mgr || iosource_mgr->GetPktSrcs().empty() )
|
||||
return t;
|
||||
|
||||
// This obviously only works for a single source ...
|
||||
iosource::PktSrc* src = pkt_srcs.front();
|
||||
iosource::PktSrc* src = iosource_mgr->GetPktSrcs().front();
|
||||
|
||||
if ( net_is_processing_suspended() )
|
||||
return src->CurrentPacketTimestamp();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue