From a32d6834adb12571c764bd8448b1386ddc5b4fb8 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Thu, 7 Jun 2012 15:26:29 +0100 Subject: qget test - fix null pointer dereference If the server sends a redirect with no body, the file is null Change-Id: I49fd1d8a4cdd404497ebef4c7f3b478960776896 Reviewed-by: Richard J. Moore --- tests/manual/qnetworkaccessmanager/qget/transferitem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/manual/qnetworkaccessmanager/qget/transferitem.cpp b/tests/manual/qnetworkaccessmanager/qget/transferitem.cpp index 1565292e6d..dcff73df2f 100644 --- a/tests/manual/qnetworkaccessmanager/qget/transferitem.cpp +++ b/tests/manual/qnetworkaccessmanager/qget/transferitem.cpp @@ -122,7 +122,7 @@ void DownloadItem::finished() qDebug() << "too many redirects"; } else { //follow redirect - if (outputFile->isOpen()) { + if (outputFile && outputFile->isOpen()) { if (!outputFile->seek(0) || !outputFile->resize(0)) { outputFile->close(); outputFile->remove(); -- cgit v1.2.3