Module: check_mk
Branch: master
Commit: c5d0d1d6588725f7549595451258f7ef0fc55aa8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c5d0d1d6588725…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Mar 28 10:36:10 2014 +0100
FIX Availablity: Prevent crash if the notification period is missing
There are some setup where the notification period of a nagios object was set to NULL.
---
.werks/739 | 8 ++++++++
ChangeLog | 1 +
livestatus/src/TableStateHistory.cc | 5 +++++
3 files changed, 14 insertions(+)
diff --git a/.werks/739 b/.werks/739
new file mode 100644
index 0000000..599abd9
--- /dev/null
+++ b/.werks/739
@@ -0,0 +1,8 @@
+Title: Availablity: Prevent crash if the notification period is missing
+Level: 1
+Component: core
+Version: 1.2.5i1
+Date: 1395999230
+Class: fix
+
+There are some setup where the notification period of a nagios object was set to NULL.
diff --git a/ChangeLog b/ChangeLog
index 7064a84..7aada6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@
* 0282 FIX: TIMEPERIOD TRANSITION messages no longer cut at 64 bytes...
* 0730 FIX: cmc: fixed bug displaying logentries after a logfile rotation...
* 0140 FIX: Fixed unwanted handling of hostname as regex...
+ * 0739 FIX: Availablity: Prevent crash if the notification period is missing...
Checks & Agents:
* 0306 esx_vsphere_counters: added missing ramdisk levels sfcbtickets
diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc
index a399e9e..ee1f8c6 100644
--- a/livestatus/src/TableStateHistory.cc
+++ b/livestatus/src/TableStateHistory.cc
@@ -527,6 +527,11 @@ void TableStateHistory::answerQuery(Query *query)
else
state->_notification_period = (char *)"";
+ // If for some reason the notification period is missing set a default
+ if (state->_notification_period == NULL) {
+ state->_notification_period = (char *)"";
+ }
+
// Same for service period. For Nagios this is a bit different, since
this
// is no native field but just a custom variable
if (state->_service != 0)