summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2010-05-13 13:31:43 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2010-05-13 13:46:44 (GMT)
commit20689ba77501c6c91d3db78f81f7ce64e7d15b95 (patch)
tree69752a593c79de1eb52bee674ca8e51e3678849b /src/network
parent4698e02579a4427c7a4ff7d59b1e37ba28ebc8e0 (diff)
downloadQt-20689ba77501c6c91d3db78f81f7ce64e7d15b95.zip
Qt-20689ba77501c6c91d3db78f81f7ce64e7d15b95.tar.gz
Qt-20689ba77501c6c91d3db78f81f7ce64e7d15b95.tar.bz2
QNAM HTTP: Preemptive anti crash if() statement
Task-number: QTBUG-10649
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qhttpnetworkreply.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/access/qhttpnetworkreply.cpp b/src/network/access/qhttpnetworkreply.cpp
index 338236e..108ba8a 100644
--- a/src/network/access/qhttpnetworkreply.cpp
+++ b/src/network/access/qhttpnetworkreply.cpp
@@ -179,6 +179,9 @@ qint64 QHttpNetworkReply::bytesAvailableNextBlock() const
QByteArray QHttpNetworkReply::readAny()
{
Q_D(QHttpNetworkReply);
+ if (d->responseData.bufferCount() == 0)
+ return QByteArray();
+
// we'll take the last buffer, so schedule another read from http
if (d->downstreamLimited && d->responseData.bufferCount() == 1)
d->connection->d_func()->readMoreLater(this);