[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kopete/KDE/4.12] plugins/otr: Workaround issue in libotr 4.0.0.
From:       Michael Zanetti <mzanetti () kde ! org>
Date:       2014-01-09 8:11:19
Message-ID: E1W1Ahz-00029k-CG () scm ! kde ! org
[Download RAW message or body]

Git commit 5e25a663ca77c22533e7f77277ca84f2af838e9d by Michael Zanetti.
Committed on 06/01/2014 at 12:20.
Pushed by mzanetti into branch 'KDE/4.12'.

Workaround issue in libotr 4.0.0.

This still has an issue with fragmentation as long as libotr 4.0.1 is
not released, but at least it doesn't crash.

CCBUG: 328999

M  +7    -2    plugins/otr/otrlchatinterface.cpp

http://commits.kde.org/kopete/5e25a663ca77c22533e7f77277ca84f2af838e9d

diff --git a/plugins/otr/otrlchatinterface.cpp b/plugins/otr/otrlchatinterface.cpp
index 2b8e806..f248d85 100644
--- a/plugins/otr/otrlchatinterface.cpp
+++ b/plugins/otr/otrlchatinterface.cpp
@@ -236,10 +236,15 @@ void OtrlChatInterface::still_secure(void *opdata, ConnContext \
*context, int is_  }
 
 int OtrlChatInterface::max_message_size(void *opdata, ConnContext *context){
-	Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata);
-
 	Q_UNUSED(context)
 
+	if (!opdata) {
+		kDebug(14318) << "Trying to determine max message size of unknown session. \
Fragmentation will not work."; +		return 0;
+	}
+
+	Kopete::ChatSession *session= ((Kopete::ChatSession*)opdata);
+
 	kDebug(14318) << session->protocol()->pluginId();
 
 	if( session->protocol()->pluginId() == "WlmProtocol" ){


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic