mirror of https://github.com/Icinga/icinga2.git
livestatus: fix missing object lock on array in attribute filter
This commit is contained in:
parent
32a1f50116
commit
e9eb40c1f7
|
@ -20,6 +20,7 @@
|
||||||
#include "livestatus/attributefilter.h"
|
#include "livestatus/attributefilter.h"
|
||||||
#include "base/convert.h"
|
#include "base/convert.h"
|
||||||
#include "base/array.h"
|
#include "base/array.h"
|
||||||
|
#include "base/objectlock.h"
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
|
@ -38,6 +39,7 @@ bool AttributeFilter::Apply(const Table::Ptr& table, const Value& row)
|
||||||
if (value.IsObjectType<Array>()) {
|
if (value.IsObjectType<Array>()) {
|
||||||
if (m_Operator == ">=") {
|
if (m_Operator == ">=") {
|
||||||
Array::Ptr array = value;
|
Array::Ptr array = value;
|
||||||
|
ObjectLock olock(array);
|
||||||
BOOST_FOREACH(const String& item, array) {
|
BOOST_FOREACH(const String& item, array) {
|
||||||
if (item == m_Operand)
|
if (item == m_Operand)
|
||||||
return true; /* Item found in list. */
|
return true; /* Item found in list. */
|
||||||
|
|
Loading…
Reference in New Issue