summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-10-13 15:32:14 +0200
committerAllan Sandfeld Jensen <allan.jensen@digia.com>2014-10-13 15:58:50 +0200
commit13ebee35e169a8b1210851ec494951815c70620c (patch)
tree8fbe5690a8ba1f92ec61146cf10ba0a9112a10e7
parent02f477c73da492c0fc85a2e0fccde2384f4611da (diff)
downloadqtwebkit-13ebee35e169a8b1210851ec494951815c70620c.tar.gz
Fix crash when a network-request is aborted while forwarding data
Since we forward data block-wise a network request may be aborted while we are still forwarding received data. In that case we should stop the forwarding. Task-number: QTBUG-41877 Change-Id: Ia34bbdcacdc4eb70a2e814d3b4bada9844abbb83 Reviewed-by: Michael Bruning <michael.bruning@digia.com>
-rw-r--r--Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 5990a4075..fc6954610 100644
--- a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -687,9 +687,12 @@ void QNetworkReplyHandler::forwardData()
// -1 means we do not provide any data about transfer size to inspector so it would use
// Content-Length headers or content size to show transfer size.
client->didReceiveData(m_resourceHandle, buffer, readSize, -1);
+ // Check if the request has been aborted or this reply-handler was otherwise released.
+ if (wasAborted() || !m_replyWrapper)
+ break;
}
delete[] buffer;
- if (bytesAvailable > 0)
+ if (bytesAvailable > 0 && m_replyWrapper)
m_queue.requeue(&QNetworkReplyHandler::forwardData);
}