wasm: Fix integer overflow in FetchRequest

Remove code which is trying to unset flag that has never been set
before. Subtracting flag on unsigned int "attributes" can cause integer
overlow.

Fixes: QTBUG-128929
Pick-to: 6.7 6.5
Change-Id: I4128819f29a841b73b6a08aeba795dcae9dc2e51
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 21be40019f8adedf1e592b9b8ba0d965b857eef3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Piotr Wierciński 2024-09-16 12:38:37 +02:00 committed by Qt Cherry-pick Bot
parent 57f2dff05c
commit e9f1dd072d

View File

@ -264,11 +264,6 @@ void QNetworkReplyWasmImplPrivate::doSendRequest()
attr.attributes += EMSCRIPTEN_FETCH_APPEND;
}
if (CacheLoadControlAttribute == QNetworkRequest::AlwaysNetwork ||
request.attribute(QNetworkRequest::CacheSaveControlAttribute, false).toBool()) {
attr.attributes -= EMSCRIPTEN_FETCH_PERSIST_FILE;
}
attr.withCredentials = request.attribute(QNetworkRequest::UseCredentialsAttribute, false).toBool();
attr.onsuccess = QNetworkReplyWasmImplPrivate::downloadSucceeded;
attr.onerror = QNetworkReplyWasmImplPrivate::downloadFailed;