HTTP internals: do not access reply that was deleted already

... rather than crashing.

Task-number: QTBUG-32404
Change-Id: Ia2f938394fb451459564ef5966419f952b3e2d0e
Reviewed-by: Richard J. Moore <rich@kde.org>
bb10
Peter Hartmann 2013-07-22 12:14:41 +02:00 committed by The Qt Project
parent 3f95ae8e2f
commit 78f9f4b497
1 changed files with 3 additions and 0 deletions

View File

@ -1116,6 +1116,9 @@ void QHttpNetworkConnectionChannel::_q_error(QAbstractSocket::SocketError socket
errorCode = QNetworkReply::RemoteHostClosedError;
}
} else if (state == QHttpNetworkConnectionChannel::ReadingState) {
if (!reply)
break;
if (!reply->d_func()->expectContent()) {
// No content expected, this is a valid way to have the connection closed by the server
return;