[swift] fix #706719 - fixed another crash during login

Jan Kaluža jkaluza at fedoraproject.org
Wed May 25 12:18:37 UTC 2011


commit 838121ef9e1f541f51031a5665c47be794783c94
Author: Jan Kaluza <hanzz.k at gmail.com>
Date:   Wed May 25 14:17:35 2011 +0200

    fix #706719 - fixed another crash during login

 swift-vector-refs.patch |  127 +++++++++++++++++++++++++++++++++++++++++++++++
 swift.spec              |    9 +++-
 2 files changed, 134 insertions(+), 2 deletions(-)
---
diff --git a/swift-vector-refs.patch b/swift-vector-refs.patch
new file mode 100644
index 0000000..7dcb3bc
--- /dev/null
+++ b/swift-vector-refs.patch
@@ -0,0 +1,127 @@
+From 3f72e2c3b7ce5a83287dc136c68b7ef6d2cc66bd Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Remko=20Tron=C3=A7on?= <git at el-tramo.be>
+Date: Mon, 23 May 2011 20:57:05 +0200
+Subject: [PATCH] Fixed const references to vectors.
+
+This could potentially cause crashes (same as a previous patch).
+---
+ Swift/Controllers/Roster/RosterController.cpp |    2 +-
+ Swift/Controllers/Roster/RosterController.h   |    2 +-
+ Swiften/Elements/DiscoInfo.h                  |    2 +-
+ Swiften/Elements/FormField.h                  |    2 +-
+ Swiften/Elements/JinglePayload.h              |    2 +-
+ Swiften/Elements/MUCUserPayload.h             |    4 ++--
+ Swiften/Elements/SearchPayload.h              |    2 +-
+ Swiften/Jingle/JingleSession.h                |    2 +-
+ 8 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/Swift/Controllers/Roster/RosterController.cpp b/Swift/Controllers/Roster/RosterController.cpp
+index 706f50a..5b61abf 100644
+--- a/Swift/Controllers/Roster/RosterController.cpp
++++ b/Swift/Controllers/Roster/RosterController.cpp
+@@ -142,7 +142,7 @@ void RosterController::handleOnJIDRemoved(const JID& jid) {
+ 	roster_->removeContact(jid);
+ }
+ 
+-void RosterController::handleOnJIDUpdated(const JID& jid, const std::string& oldName, const std::vector<std::string> passedOldGroups) {
++void RosterController::handleOnJIDUpdated(const JID& jid, const std::string& oldName, const std::vector<std::string>& passedOldGroups) {
+ 	if (oldName != xmppRoster_->getNameForJID(jid)) {
+ 		roster_->applyOnItems(SetName(nickResolver_->jidToNick(jid), jid));
+ 	}
+diff --git a/Swift/Controllers/Roster/RosterController.h b/Swift/Controllers/Roster/RosterController.h
+index f224180..0a2b818 100644
+--- a/Swift/Controllers/Roster/RosterController.h
++++ b/Swift/Controllers/Roster/RosterController.h
+@@ -57,7 +57,7 @@ namespace Swift {
+ 			void handleOnJIDAdded(const JID &jid);
+ 			void handleRosterCleared();
+ 			void handleOnJIDRemoved(const JID &jid);
+-			void handleOnJIDUpdated(const JID &jid, const std::string& oldName, const std::vector<std::string> oldGroups);
++			void handleOnJIDUpdated(const JID &jid, const std::string& oldName, const std::vector<std::string>& oldGroups);
+ 			void handleStartChatRequest(const JID& contact);
+ 			void handleChangeStatusRequest(StatusShow::Type show, const std::string &statusText);
+ 			void handleShowOfflineToggled(bool state);
+diff --git a/Swiften/Elements/DiscoInfo.h b/Swiften/Elements/DiscoInfo.h
+index d5bf64a..b73165e 100644
+--- a/Swiften/Elements/DiscoInfo.h
++++ b/Swiften/Elements/DiscoInfo.h
+@@ -90,7 +90,7 @@ namespace Swift {
+ 				extensions_.push_back(form);
+ 			}
+ 
+-			const std::vector<Form::ref> getExtensions() const {
++			const std::vector<Form::ref>& getExtensions() const {
+ 				return extensions_;
+ 			}
+ 
+diff --git a/Swiften/Elements/FormField.h b/Swiften/Elements/FormField.h
+index f455303..517369b 100644
+--- a/Swiften/Elements/FormField.h
++++ b/Swiften/Elements/FormField.h
+@@ -48,7 +48,7 @@ namespace Swift {
+ 				return options;
+ 			}
+ 
+-			const std::vector<std::string> getRawValues() const {
++			const std::vector<std::string>& getRawValues() const {
+ 				return rawValues;
+ 			}
+ 
+diff --git a/Swiften/Elements/JinglePayload.h b/Swiften/Elements/JinglePayload.h
+index 59d3c99..59fba7b 100644
+--- a/Swiften/Elements/JinglePayload.h
++++ b/Swiften/Elements/JinglePayload.h
+@@ -102,7 +102,7 @@ namespace Swift {
+ 				this->contents.push_back(content);
+ 			}
+ 
+-			const std::vector<JingleContent::ref> getContents() const {
++			const std::vector<JingleContent::ref>& getContents() const {
+ 				return contents;
+ 			}
+ 
+diff --git a/Swiften/Elements/MUCUserPayload.h b/Swiften/Elements/MUCUserPayload.h
+index fb6d4c4..7460c35 100644
+--- a/Swiften/Elements/MUCUserPayload.h
++++ b/Swiften/Elements/MUCUserPayload.h
+@@ -52,9 +52,9 @@ namespace Swift {
+ 		
+ 			void addStatusCode(StatusCode code) {statusCodes_.push_back(code);}
+ 
+-			const std::vector<Item> getItems() const {return items_;}
++			const std::vector<Item>& getItems() const {return items_;}
+ 
+-			const std::vector<StatusCode> getStatusCodes() const {return statusCodes_;}
++			const std::vector<StatusCode>& getStatusCodes() const {return statusCodes_;}
+ 
+ 		private:
+ 			std::vector<Item> items_;
+diff --git a/Swiften/Elements/SearchPayload.h b/Swiften/Elements/SearchPayload.h
+index 3a484cc..d6d7ed1 100644
+--- a/Swiften/Elements/SearchPayload.h
++++ b/Swiften/Elements/SearchPayload.h
+@@ -74,7 +74,7 @@ namespace Swift {
+ 				this->email = v;
+ 			}
+ 
+-			const std::vector<Item> getItems() const {
++			const std::vector<Item>& getItems() const {
+ 				return items;
+ 			}
+ 
+diff --git a/Swiften/Jingle/JingleSession.h b/Swiften/Jingle/JingleSession.h
+index c00492d..fe8aa01 100644
+--- a/Swiften/Jingle/JingleSession.h
++++ b/Swiften/Jingle/JingleSession.h
+@@ -37,7 +37,7 @@ namespace Swift {
+ 				return JingleContent::ref();
+ 			}
+ 
+-			const std::vector<JingleContent::ref> getContents() const {
++			const std::vector<JingleContent::ref>& getContents() const {
+ 				return contents;
+ 			}
+ 
+-- 
+1.6.1
+
diff --git a/swift.spec b/swift.spec
index bb6ed2e..23fa3e4 100644
--- a/swift.spec
+++ b/swift.spec
@@ -1,7 +1,7 @@
 Summary: XMPP client
 Name: swift
 Version: 1.0
-Release: 2%{?dist}
+Release: 3%{?dist}
 Group: Applications/Internet
 License: GPLv3
 # The source for this package was pulled from upstream's vcs.  Use the
@@ -14,6 +14,7 @@ Source0: %{name}-%{version}.tar.gz
 Source1: %{name}.desktop
 Patch0: swift-build.patch
 Patch1: swift-login-crash.patch
+Patch2: swift-vector-refs.patch
 URL: http://swift.im/
 BuildRequires: scons
 BuildRequires: qt-devel
@@ -37,6 +38,7 @@ application.
 %setup -q -n %{name}-%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 # Remove 3rd party libraries.
 find 3rdParty/Boost -delete
@@ -62,7 +64,7 @@ echo 'linkflags="-lpthread -lX11 -lQtDBus"' >> config.py
 echo 'ccflags="%{optflags} -DBOOST_FILESYSTEM_VERSION=2".split(" ")' >> config.py
 
 %build
-scons V=1 Swift
+scons V=1 Swift %{?_smp_mflags}
 
 %install
 install -p -D -m 755 Swift/QtUI/swift \
@@ -83,6 +85,9 @@ desktop-file-install \
 %{_datadir}/pixmaps/%{name}.xpm
 
 %changelog
+* Wed May 25 2011 Jan Kaluza <jkaluza at redhat.com> - 1.0-3
+- fix #706719 - fixed another crash during login
+
 * Tue Apr 26 2011 Jan Kaluza <jkaluza at redhat.com> - 1.0-2
 - fix #697832 - fixed crash during login
 


More information about the scm-commits mailing list