[icinga-checkins] icinga.org: icinga2/master: Make sure that object names aren't empty

git at icinga.org git at icinga.org
Tue May 17 11:44:10 CEST 2016


Module: icinga2
Branch: master
Commit: bd896935d6b7cff4b97d1be010ca023c793b83cb
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=bd896935d6b7cff4b97d1be010ca023c793b83cb

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Wed May 11 09:48:18 2016 +0200

Make sure that object names aren't empty

fixes #9989

---

 lib/config/configitem.cpp |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp
index f767c4c..580bb97 100644
--- a/lib/config/configitem.cpp
+++ b/lib/config/configitem.cpp
@@ -219,6 +219,9 @@ ConfigObject::Ptr ConfigItem::Commit(bool discard)
 	NameComposer *nc = dynamic_cast<NameComposer *>(type.get());
 
 	if (nc) {
+		if (name.IsEmpty())
+			BOOST_THROW_EXCEPTION(ScriptError("Object name must not be empty.", m_DebugInfo));
+
 		name = nc->MakeName(name, dobj);
 
 		if (name.IsEmpty())



More information about the icinga-checkins mailing list