livestatus: fix missing object lock on array in attribute filter

This commit is contained in:
Michael Friedrich 2013-07-16 15:38:59 +02:00
parent 32a1f50116
commit e9eb40c1f7
1 changed files with 2 additions and 0 deletions

View File

@ -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. */