mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-12 10:58:28 -04:00
if given timestamp is in the future, reset it, it is likely invalid
This commit is contained in:
@@ -60,10 +60,16 @@ Event::Event(
|
||||
std::string notes;
|
||||
createNotes(notes);
|
||||
|
||||
struct timeval now;
|
||||
gettimeofday(&now, 0);
|
||||
|
||||
bool untimedEvent = false;
|
||||
if ( !start_time.tv_sec ) {
|
||||
untimedEvent = true;
|
||||
gettimeofday(&start_time, 0);
|
||||
start_time = now;
|
||||
} else if ( start_time.tv_sec > now.tv_sec ) {
|
||||
Error("StartTime in the future");
|
||||
start_time = now;
|
||||
}
|
||||
|
||||
Storage * storage = monitor->getStorage();
|
||||
|
||||
Reference in New Issue
Block a user