]> granicus.if.org Git - icinga2/commitdiff
Lock Objects during serialization
authorElias Ohm <eohm@novomind.com>
Sun, 28 Apr 2019 20:13:19 +0000 (22:13 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 16 May 2019 14:30:53 +0000 (16:30 +0200)
old behaviour was to only lock arrays, dictionaries and namespaces but not other objects

(cherry picked from commit 91296c2a250b1aeb0976f252eba5ffdce93c8590)

lib/base/serializer.cpp

index cb4088ed75519a4a7bf51e55b207077b9e20f0a0..b6ba1d51eb021d733169598f719f579b2e8f5595 100644 (file)
@@ -146,6 +146,8 @@ static Object::Ptr SerializeObject(const Object::Ptr& input, int attributeTypes,
        DictionaryData fields;
        fields.reserve(type->GetFieldCount() + 1);
 
+       ObjectLock olock(input);
+
        for (int i = 0; i < type->GetFieldCount(); i++) {
                Field field = type->GetFieldInfo(i);