[icinga-checkins] icinga.org: icinga2/master: Fix crash on Windows

git at icinga.org git at icinga.org
Tue Jul 12 15:33:56 CEST 2016


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

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Tue Jul 12 15:33:05 2016 +0200

Fix crash on Windows

fixes #11730

---

 lib/base/socketevents-poll.cpp |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/base/socketevents-poll.cpp b/lib/base/socketevents-poll.cpp
index 784212a..3532f56 100644
--- a/lib/base/socketevents-poll.cpp
+++ b/lib/base/socketevents-poll.cpp
@@ -55,6 +55,9 @@ void SocketEventEnginePoll::ThreadProc(int tid)
 				typedef std::map<SOCKET, SocketEventDescriptor>::value_type kv_pair;
 
 				BOOST_FOREACH(const kv_pair& desc, m_Sockets[tid]) {
+					if (desc.second.Events == 0)
+						continue;
+
 					if (desc.second.EventInterface)
 						desc.second.EventInterface->m_EnginePrivate = &pfds[i];
 
@@ -65,6 +68,8 @@ void SocketEventEnginePoll::ThreadProc(int tid)
 					i++;
 				}
 
+				pfds.resize(i);
+
 				m_FDChanged[tid] = false;
 				m_CV[tid].notify_all();
 			}



More information about the icinga-checkins mailing list