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

List:       kde-commits
Subject:    [kopete] plugins/otr: Workaround issue in libotr 4.0.0.
From:       Michael Zanetti <mzanetti () kde ! org>
Date:       2014-01-06 12:22:48
Message-ID: E1W09Ci-00069a-8p () scm ! kde ! org
[Download RAW message or body]

Git commit 9cc149f410c8edc06f399ff8add074589a489b38 by Michael Zanetti.
Committed on 06/01/2014 at 12:20.
Pushed by mzanetti into branch 'master'.

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/9cc149f410c8edc06f399ff8add074589a489b38

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