[icinga-checkins] icinga.org: icinga2/master: Disallow casting "" to an Object

git at icinga.org git at icinga.org
Wed Aug 10 11:15:22 CEST 2016


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

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Wed Aug 10 11:14:33 2016 +0200

Disallow casting "" to an Object

fixes #12390

---

 lib/base/value.hpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/base/value.hpp b/lib/base/value.hpp
index 96be16d..3d12a26 100644
--- a/lib/base/value.hpp
+++ b/lib/base/value.hpp
@@ -144,7 +144,7 @@ public:
 	template<typename T>
 	operator intrusive_ptr<T>(void) const
 	{
-		if (IsEmpty())
+		if (IsEmpty() && !IsString())
 			return intrusive_ptr<T>();
 
 		if (!IsObject())



More information about the icinga-checkins mailing list