Module: check_mk
Branch: master
Commit: 453d4e2dd7d59bc178a1cd34aae61708e7d4ce89
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=453d4e2dd7d59b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Sep 2 10:54:43 2015 +0200
#2542 FIX Fix segmentation fault when filtering for service columns in log table
The crash occurred when you filtered for a text type service column in the
log table while entries did not have service information (host alerts).
---
.werks/2542 | 10 ++++++++++
ChangeLog | 1 +
livestatus/src/StringColumnFilter.cc | 3 +++
3 files changed, 14 insertions(+)
diff --git a/.werks/2542 b/.werks/2542
new file mode 100644
index 0000000..75670d3
--- /dev/null
+++ b/.werks/2542
@@ -0,0 +1,10 @@
+Title: Fix segmentation fault when filtering for service columns in log table
+Level: 2
+Component: livestatus
+Compatible: compat
+Version: 1.2.7i3
+Date: 1441184018
+Class: fix
+
+The crash occurred when you filtered for a text type service column in the
+log table while entries did not have service information (host alerts).
diff --git a/ChangeLog b/ChangeLog
index 990ff03..8c896b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -235,6 +235,7 @@
Livestatus:
* 2493 FIX: Fixed wrong JSON format when using stats queries together with header
columns...
+ * 2542 FIX: Fix segmentation fault when filtering for service columns in log
table...
HW/SW-Inventory:
* 2128 mk_inventory.vbs: inventory plugin for Windows now available as vbs script...
diff --git a/livestatus/src/StringColumnFilter.cc b/livestatus/src/StringColumnFilter.cc
index 6a3923e..4dde056 100644
--- a/livestatus/src/StringColumnFilter.cc
+++ b/livestatus/src/StringColumnFilter.cc
@@ -68,6 +68,9 @@ bool StringColumnFilter::accepts(void *data)
{
bool pass = true;
char *act_string = _column->getValue(data);
+ if (!act_string)
+ act_string = ""; // e.g. current_service_perf_data in host entry in log
table
+
switch (_opid) {
case OP_EQUAL:
pass = _ref_string == act_string; break;