diff options
author | Michael BrĂ¼ning <michael.bruning@qt.io> | 2023-12-06 10:40:31 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-12-08 02:06:39 +0000 |
commit | 0aad55db5c1df97539c992f2ee92a3daa78c8a5e (patch) | |
tree | 258dcc2b3745a9b1bc40ee942698339ee1e53b11 | |
parent | 1e79c97db487c3f14dd8966dbfc3e322b2e4b441 (diff) |
Fix unconditional pointer access in QWebEngineDownloadRequest::page
The adapterClient pointer in QWebEngineDownloadRequestPrivate can be
initialized to a nullptr in some scenarios, but was used without
checking if the pointer is actually set.
Pick-to: 6.5
Task-number: QTBUG-119763
Change-Id: I7a8653e7f0f5d920dbe69785fb3ce3518c96cc24
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 3c6056d062c3b94ff9031cb4931a59de06137d1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/core/api/qwebenginedownloadrequest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/api/qwebenginedownloadrequest.cpp b/src/core/api/qwebenginedownloadrequest.cpp index 07ea37600..cbf46b448 100644 --- a/src/core/api/qwebenginedownloadrequest.cpp +++ b/src/core/api/qwebenginedownloadrequest.cpp @@ -607,7 +607,7 @@ QString QWebEngineDownloadRequest::interruptReasonString() const QWebEnginePage *QWebEngineDownloadRequest::page() const { Q_D(const QWebEngineDownloadRequest); - if (d->adapterClient->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient) + if (d->adapterClient && d->adapterClient->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient) return const_cast<QWebEnginePage *>(static_cast<const QWebEnginePage *>(d->adapterClient->holdingQObject())); return nullptr; } |