[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

jocelyn.turcotte at nokia.com jocelyn.turcotte at nokia.com
Wed Dec 22 18:23:11 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 64ec5c94de51af9984fbff586c2d03eda019a82d
Author: jocelyn.turcotte at nokia.com <jocelyn.turcotte at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 10 10:41:52 2010 +0000

    [Qt] Refactor QNetworkReplyHandler::finish() to prevent crashes.
    https://bugs.webkit.org/show_bug.cgi?id=50761
    
    Reviewed by Kenneth Rohde Christiansen.
    
    This patch change the order to check if m_reply is null instead,
    explicitly deleting the reply before calling start() for a redirect,
    or after calling didFinishLoading()/didFail() in other cases.
    
    * platform/network/qt/QNetworkReplyHandler.cpp:
    (WebCore::QNetworkReplyHandler::finish):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73708 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a547b92..d19a814 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,20 @@
 
         Reviewed by Kenneth Rohde Christiansen.
 
+        [Qt] Refactor QNetworkReplyHandler::finish() to prevent crashes.
+        https://bugs.webkit.org/show_bug.cgi?id=50761
+
+        This patch change the order to check if m_reply is null instead,
+        explicitly deleting the reply before calling start() for a redirect,
+        or after calling didFinishLoading()/didFail() in other cases.
+
+        * platform/network/qt/QNetworkReplyHandler.cpp:
+        (WebCore::QNetworkReplyHandler::finish):
+
+2010-12-09  Jocelyn Turcotte  <jocelyn.turcotte at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
         [Qt] Make sure we send the response before any data.
         https://bugs.webkit.org/show_bug.cgi?id=50760
 
diff --git a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index ac17261..8bb0f85 100644
--- a/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -300,29 +300,33 @@ void QNetworkReplyHandler::finish()
         return;
     }
 
-    QNetworkReply* oldReply = m_reply;
+    if (!m_redirected) {
+        if (!m_reply->error() || ignoreHttpError(m_reply, m_responseContainsData)) {
+            client->didFinishLoading(m_resourceHandle, 0);
+        } else {
+            QUrl url = m_reply->url();
+            int httpStatusCode = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
 
-    if (m_redirected) {
-        resetState();
-        start();
-    } else if (!m_reply->error() || ignoreHttpError(m_reply, m_responseContainsData)) {
-        client->didFinishLoading(m_resourceHandle, 0);
+            if (httpStatusCode) {
+                ResourceError error("HTTP", httpStatusCode, url.toString(), m_reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString());
+                client->didFail(m_resourceHandle, error);
+            } else {
+                ResourceError error("QtNetwork", m_reply->error(), url.toString(), m_reply->errorString());
+                client->didFail(m_resourceHandle, error);
+            }
+        }
+        if (m_reply) {
+            m_reply->deleteLater();
+            m_reply = 0;
+        }
     } else {
-        QUrl url = m_reply->url();
-        int httpStatusCode = m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
-
-        if (httpStatusCode) {
-            ResourceError error("HTTP", httpStatusCode, url.toString(), m_reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString());
-            client->didFail(m_resourceHandle, error);
-        } else {
-            ResourceError error("QtNetwork", m_reply->error(), url.toString(), m_reply->errorString());
-            client->didFail(m_resourceHandle, error);
+        if (m_reply) {
+            m_reply->deleteLater();
+            m_reply = 0;
         }
+        resetState();
+        start();
     }
-
-    oldReply->deleteLater();
-    if (oldReply == m_reply)
-        m_reply = 0;
 }
 
 void QNetworkReplyHandler::sendResponseIfNeeded()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list