Skip to content

Commit

Permalink
Validate timeperiod segments
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarbeutner committed Jan 29, 2015
1 parent a3e0c9d commit 2f44581
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/config/configitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ bool ConfigItem::ActivateItems(void)
}

upq.Join();
upq.ReportExceptions("ConfigItem");

#ifdef I2_DEBUG
BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) {
Expand Down
3 changes: 3 additions & 0 deletions lib/icinga/legacytimeperiod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,9 @@ void LegacyTimePeriod::ProcessTimeRanges(const String& timeranges, tm *reference

BOOST_FOREACH(const String& range, ranges) {
Dictionary::Ptr segment = ProcessTimeRange(range, reference);
if (segment->Get("begin") >= segment->Get("end"))
BOOST_THROW_EXCEPTION(std::invalid_argument("Time period segment ends before it begins"));

result->Add(segment);
}
}
Expand Down

0 comments on commit 2f44581

Please sign in to comment.