From 20689ba77501c6c91d3db78f81f7ce64e7d15b95 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Thu, 13 May 2010 15:31:43 +0200 Subject: QNAM HTTP: Preemptive anti crash if() statement Task-number: QTBUG-10649 --- src/network/access/qhttpnetworkreply.cpp | 3 +++ 1 file changed, 3 insertions(+) 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); -- cgit v0.12