summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2023-04-21 16:08:05 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2023-04-24 12:04:17 +0300
commitc23ff539be0f9cedc3308d8c6c83b95af4943908 (patch)
tree31a75a24d2ab8576b50d583e13a700ef429c5249 /src
parent29ac49798ac237a31eac754eb6236d72b8d02298 (diff)
HttpDownloader: fix nullptr dereference
The HttpDownloader::Private::shutdown() deletes and sets the pointer to the destination file device to null, and the code tried access its members still afterwards. Changed the order of the calls to fix. Change-Id: I494edfa4af1e112119475c2999ad78e07800194e Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/libs/kdtools/filedownloader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libs/kdtools/filedownloader.cpp b/src/libs/kdtools/filedownloader.cpp
index 6152811aa..a764b6ea4 100644
--- a/src/libs/kdtools/filedownloader.cpp
+++ b/src/libs/kdtools/filedownloader.cpp
@@ -1509,9 +1509,9 @@ void KDUpdater::HttpDownloader::startDownload(const QUrl &url)
qCWarning(QInstaller::lcInstallerInstallLog) << "File exists but installer is unable to open it.";
else
qCWarning(QInstaller::lcInstallerInstallLog) << "File does not exist.";
- d->shutDown();
setDownloadAborted(tr("Cannot download %1. Cannot create file \"%2\": %3").arg(
url.toString(), d->destination->fileName(), d->destination->errorString()));
+ d->shutDown();
}
}
}