rpms/synergy/F-9 synergy-1.3.1-copynpaste-crash.patch, NONE, 1.1 synergy.spec, 1.21, 1.22

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Mon Jun 2 10:02:07 UTC 2008


Author: jwrdegoede

Update of /cvs/extras/rpms/synergy/F-9
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4298

Modified Files:
	synergy.spec 
Added Files:
	synergy-1.3.1-copynpaste-crash.patch 
Log Message:
* Mon Jun  2 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 1.3.1-8
- Fix synergy crashing on copy and paste (bz 434539)


synergy-1.3.1-copynpaste-crash.patch:

--- NEW FILE synergy-1.3.1-copynpaste-crash.patch ---
--- synergy-1.3.1/lib/platform/CXWindowsClipboard.h~	2008-05-31 00:03:11.000000000 +0200
+++ synergy-1.3.1/lib/platform/CXWindowsClipboard.h	2008-05-31 00:03:11.000000000 +0200
@@ -265,7 +265,7 @@ private:
 	bool				insertMultipleReply(Window, ::Time, Atom);
 	void				insertReply(CReply*);
 	void				pushReplies();
-	void				pushReplies(CReplyMap::iterator,
+	void				pushReplies(Window requestor,
 							CReplyList&, CReplyList::iterator);
 	bool				sendReply(CReply*);
 	void				clearReplies();
--- synergy-1.3.1/lib/platform/CXWindowsClipboard.cpp.foobar	2006-04-02 03:47:03.000000000 +0200
+++ synergy-1.3.1/lib/platform/CXWindowsClipboard.cpp	2008-05-31 00:09:16.000000000 +0200
@@ -219,7 +219,7 @@ CXWindowsClipboard::processRequest(Windo
 		if (reply->m_replied && reply->m_property == property) {
 			// if reply is complete then remove it and start the
 			// next one.
-			pushReplies(index, replies, index2);
+			pushReplies(index->first, replies, index2);
 			return true;
 		}
 	}
@@ -928,17 +928,23 @@ CXWindowsClipboard::pushReplies()
 {
 	// send the first reply for each window if that reply hasn't
 	// been sent yet.
-	for (CReplyMap::iterator index = m_replies.begin();
-								index != m_replies.end(); ++index) {
-		assert(!index->second.empty());
-		if (!index->second.front()->m_replied) {
-			pushReplies(index, index->second, index->second.begin());
+	CReplyMap::iterator index = m_replies.begin();
+	while (index != m_replies.end()) {
+		// increment index before calling pushReplies(...) as
+		// pushReplies(...) normally erases the member of the map, that
+		// index points to, invalidating index as iterator.
+		Window requestor = index->first;
+		CReplyList& replies = index->second;
+		index++;
+		assert(!replies.empty());
+		if (!replies.front()->m_replied) {
+			pushReplies(requestor, replies, replies.begin());
 		}
 	}
 }
 
 void
-CXWindowsClipboard::pushReplies(CReplyMap::iterator mapIndex,
+CXWindowsClipboard::pushReplies(Window requestor,
 				CReplyList& replies, CReplyList::iterator index)
 {
 	CReply* reply = *index;
@@ -957,9 +963,8 @@ CXWindowsClipboard::pushReplies(CReplyMa
 	// and stop watching the requestor for events.
 	if (replies.empty()) {
 		CXWindowsUtil::CErrorLock lock(m_display);
-		Window requestor = mapIndex->first;
 		XSelectInput(m_display, requestor, m_eventMasks[requestor]);
-		m_replies.erase(mapIndex);
+		m_replies.erase(requestor);
 		m_eventMasks.erase(requestor);
 	}
 }


Index: synergy.spec
===================================================================
RCS file: /cvs/extras/rpms/synergy/F-9/synergy.spec,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- synergy.spec	24 Feb 2008 00:34:51 -0000	1.21
+++ synergy.spec	2 Jun 2008 10:01:02 -0000	1.22
@@ -1,13 +1,14 @@
 Summary: Mouse and keyboard sharing utility
 Name: synergy
 Version: 1.3.1
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: GPLv2
 Group: System Environment/Daemons
 URL: http://synergy2.sourceforge.net/
 Source: http://downloads.sf.net/synergy2/synergy-%{version}.tar.gz
 Patch0: synergy-1.2.2-werror.patch
 Patch1: synergy-1.3.1-gcc43.patch
+Patch2: synergy-1.3.1-copynpaste-crash.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires: libX11-devel, libXext-devel, libXtst-devel, libXt-devel
 BuildRequires: libXinerama-devel
@@ -26,6 +27,7 @@
 %setup -q
 %patch0 -p1 -b .werror
 %patch1 -p1 -b .gcc43
+%patch2 -p1 -b .copynpaste
 autoreconf
 
 
@@ -53,6 +55,9 @@
 
 
 %changelog
+* Mon Jun  2 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 1.3.1-8
+- Fix synergy crashing on copy and paste (bz 434539)
+
 * Sun Feb 24 2008 Matthias Saou <http://freshrpms.net/> 1.3.1-7
 - Include patch to fix build failure with gcc 4.3 (#434460).
 




More information about the fedora-extras-commits mailing list