summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2019-03-04 16:29:50 +1000
committerLorn Potter <lorn.potter@gmail.com>2019-03-04 20:38:09 +0000
commit7789b77458e339320644cfc2822b008dfae9a616 (patch)
tree38878a19a2930ac49cdcaf4996e6cc62f5a34cd9
parentceb0e377b11c6d1b5cf3961901c8bb72d2020d91 (diff)
wasm: fix corrupt downloads
This would only ever put the first 16k into the buffer that gets read, so this 16k would get repeated until the size of the download. Task-number: QTBUG-74123 Change-Id: Ia53bedf6a8754d9fd83fd0ab62866cfa5af5cc1a Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r--src/network/access/qnetworkreplywasmimpl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp
index df4e034d97..b1e9853a50 100644
--- a/src/network/access/qnetworkreplywasmimpl.cpp
+++ b/src/network/access/qnetworkreplywasmimpl.cpp
@@ -265,7 +265,7 @@ qint64 QNetworkReplyWasmImpl::readData(char *data, qint64 maxlen)
Q_D(QNetworkReplyWasmImpl);
qint64 howMuch = qMin(maxlen, (d->downloadBuffer.size() - d->downloadBufferReadPosition));
- memcpy(data, d->downloadBuffer.constData(), howMuch);
+ memcpy(data, d->downloadBuffer.constData() + d->downloadBufferReadPosition, howMuch);
d->downloadBufferReadPosition += howMuch;
return howMuch;