[icinga-checkins] icinga.org: icinga2/master: Fix crash in SocketEvents::ChangeEvents

git at icinga.org git at icinga.org
Tue Feb 17 13:22:49 CET 2015


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

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Tue Feb 17 13:21:43 2015 +0100

Fix crash in SocketEvents::ChangeEvents

refs #6109

---

 lib/base/socketevents.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/base/socketevents.cpp b/lib/base/socketevents.cpp
index 81f4631..a74d16a 100644
--- a/lib/base/socketevents.cpp
+++ b/lib/base/socketevents.cpp
@@ -195,7 +195,8 @@ void SocketEvents::Unregister(void)
 
 void SocketEvents::ChangeEvents(int events)
 {
-	ASSERT(m_FD != INVALID_SOCKET);
+	if (m_FD == INVALID_SOCKET)
+		BOOST_THROW_EXCEPTION(std::runtime_error("Tried to read/write from a closed socket."));
 
 	{
 		boost::mutex::scoped_lock lock(l_SocketIOMutex);



More information about the icinga-checkins mailing list