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

git at icinga.org git at icinga.org
Wed May 11 09:48:42 CEST 2016


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

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 59e58ce..af216ee 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