[kdepimlibs] fixed infinite recursion on ssl handshake error in akonadi_imap_resource (#891620)

Martin Briza mbriza at fedoraproject.org
Wed Jun 5 11:14:11 UTC 2013


commit 408ad6a842ccc19909ff03501d03810dc2bfeae4
Author: Martin Briza <mbriza at redhat.com>
Date:   Wed Jun 5 13:13:51 2013 +0200

    fixed infinite recursion on ssl handshake error in akonadi_imap_resource (#891620)

 kdepimlibs-4.10.4-kimap_recursion.patch |   48 +++++++++++++++++++++++++++++++
 kdepimlibs.spec                         |    8 ++++-
 2 files changed, 55 insertions(+), 1 deletions(-)
---
diff --git a/kdepimlibs-4.10.4-kimap_recursion.patch b/kdepimlibs-4.10.4-kimap_recursion.patch
new file mode 100644
index 0000000..d432720
--- /dev/null
+++ b/kdepimlibs-4.10.4-kimap_recursion.patch
@@ -0,0 +1,48 @@
+--- kdepimlibs-4.10.4/kimap/sessionthread.cpp.kimap_recursion	2013-05-28 21:26:23.000000000 +0200
++++ kdepimlibs-4.10.4/kimap/sessionthread.cpp	2013-06-05 12:39:24.194506980 +0200
+@@ -24,6 +24,8 @@
+ 
+ #include <KDE/KDebug>
+ 
++#include <cstdio>
++
+ #include "imapstreamparser.h"
+ #include "message_p.h"
+ #include "session.h"
+@@ -39,7 +41,9 @@
+   : QThread(), m_hostName( hostName ), m_port( port ),
+     m_session( parent ), m_socket( 0 ), m_stream( 0 ), m_mutex( QMutex::Recursive ),
+     m_encryptedMode( false ),
+-    triedSslVersions( 0 ), doSslFallback( false )
++    triedSslVersions( 0 ),
++    doSslFallback( false ),
++    m_alreadyHandlingErrors( false )
+ {
+   // Yeah, sounds weird, but QThread object is linked to the parent
+   // thread not to itself, and I'm too lazy to introduce yet another
+@@ -222,12 +226,14 @@
+   } else {
+     QMetaObject::invokeMethod( m_session, "socketDisconnected" );
+   }
++  m_alreadyHandlingErrors = false;
+ }
+ 
+ void SessionThread::socketError()
+ {
+   QMutexLocker locker( &m_mutex );
+-  if ( doSslFallback ) {
++  if ( doSslFallback && !m_alreadyHandlingErrors ) {
++    m_alreadyHandlingErrors = true;
+     locker.unlock(); // disconnectFromHost() ends up calling reconnect()
+     m_socket->disconnectFromHost();
+   } else {
+--- kdepimlibs-4.10.4/kimap/sessionthread_p.h.kimap_recursion	2013-05-28 21:26:23.000000000 +0200
++++ kdepimlibs-4.10.4/kimap/sessionthread_p.h	2013-06-05 10:58:46.855926317 +0200
+@@ -82,6 +82,7 @@
+     bool m_encryptedMode;
+     KTcpSocket::SslVersions triedSslVersions;
+     bool doSslFallback;
++    bool m_alreadyHandlingErrors;
+ };
+ 
+ }
diff --git a/kdepimlibs.spec b/kdepimlibs.spec
index 7ea210d..7e888a4 100644
--- a/kdepimlibs.spec
+++ b/kdepimlibs.spec
@@ -7,7 +7,7 @@
 Name: kdepimlibs
 Summary: KDE PIM Libraries
 Version: 4.10.4
-Release: 1%{?dist}
+Release: 2%{?dist}
 
 # http://techbase.kde.org/Policies/Licensing_Policy
 License: LGPLv2+
@@ -20,6 +20,8 @@ URL: http://www.kde.org/
 %endif
 Source0: http://download.kde.org/%{stable}/%{version}/src/kdepimlibs-%{version}.tar.xz
 
+Patch0: kdepimlibs-4.10.4-kimap_recursion.patch
+
 ## upstream patches
 
 Requires: %{name}-kxmlrpcclient%{?_isa} = %{version}-%{release}
@@ -103,6 +105,7 @@ quite easy to use.
 %prep
 %setup -q
 
+%patch0 -p1 -b .kimap_recursion
 
 %build
 mkdir -p %{_target_platform}
@@ -284,6 +287,9 @@ update-mime-database %{_kde4_datadir}/mime >& /dev/null
 
 
 %changelog
+* Wed Jun 05 2013 Martin Briza <mbriza at redhat.com> - 4.10.4-2
+- fixed infinite recursion on ssl handshake error in akonadi_imap_resource (#891620)
+
 * Sat Jun 01 2013 Rex Dieter <rdieter at fedoraproject.org> - 4.10.4-1
 - 4.10.4
 


More information about the scm-commits mailing list