diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index 753ef6ce8..3031a2b06 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -717,7 +717,7 @@ PoolByteArray HTTPClient::read_response_body_chunk() { ret.resize(chunk.size() - 2); PoolByteArray::Write w = ret.write(); - memcpy(w.ptr(), chunk.ptr(), chunk.size() - 2); + memcpy(w.ptr(), chunk.ptr(), ret.size()); chunk.clear(); }