[Pkg-owncloud-commits] [owncloud-client] 31/121: Attempt to fix the Account::slotHandleSslErrors crash

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Jul 28 15:31:54 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 147cf798a6f13c9b53a9f1fb2db1ef26c8c63273
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date:   Wed Jun 15 18:05:56 2016 +0200

    Attempt to fix the Account::slotHandleSslErrors crash
    
    Events from the crash reporter suggest that the QNAM and its
    child replies might get deleted before returning from this method
    and the only possible cause we can see is that the inner event
    loop has something to do with it.
    
    Try keeping a ref on the QNAM while in this method to make sure
    that it won't get deleted by the inner event loop.
---
 src/libsync/account.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp
index 24c5783..99b1d5f 100644
--- a/src/libsync/account.cpp
+++ b/src/libsync/account.cpp
@@ -427,6 +427,12 @@ void Account::slotHandleSslErrors(QNetworkReply *reply , QList<QSslError> errors
         return;
     }
 
+    // SslDialogErrorHandler::handleErrors will run an event loop that might execute
+    // the deleteLater() of the QNAM before we have the chance of unwinding our stack.
+    // Keep a ref here on our stackframe to make sure that it doesn't get deleted before
+    // handleErrors returns.
+    QSharedPointer<QNetworkAccessManager> qnamLock = _am;
+
     if (_sslErrorHandler->handleErrors(errors, reply->sslConfiguration(), &approvedCerts, sharedFromThis())) {
         QSslSocket::addDefaultCaCertificates(approvedCerts);
         addApprovedCerts(approvedCerts);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list