]> granicus.if.org Git - icinga2/commitdiff
Fix crash in ConfigObjectUtility::CreateObject
authorGunnar Beutner <gunnar@beutner.name>
Tue, 18 Aug 2015 18:25:06 +0000 (20:25 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 18 Aug 2015 18:25:06 +0000 (20:25 +0200)
refs #9082

lib/remote/configobjectutility.cpp

index a87cecf6ffaf829e7ed174f1e6e1259900087b52..2968ccdb241e2791cae901f7bce0446442d26395 100644 (file)
@@ -132,7 +132,10 @@ bool ConfigObjectUtility::CreateObject(const Type::Ptr& type, const String& full
        
        Dictionary::Ptr allAttrs = new Dictionary();
        attrs->CopyTo(allAttrs);
-       nameParts->CopyTo(allAttrs);
+
+       if (nameParts)
+               nameParts->CopyTo(allAttrs);
+
        allAttrs->Remove("name");
 
        ConfigWriter::Ptr cw = new ConfigWriter(path);