]> granicus.if.org Git - icinga2/commitdiff
Fix crash in SocketEvents::ChangeEvents
authorGunnar Beutner <gunnar@beutner.name>
Tue, 17 Feb 2015 12:21:43 +0000 (13:21 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Tue, 17 Feb 2015 12:21:43 +0000 (13:21 +0100)
refs #6109

lib/base/socketevents.cpp

index 81f463120aabfad5ce284c9c09f70a648da220dc..a74d16aeff49a74744fc1d561f279757a9faebc2 100644 (file)
@@ -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);