mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
ProtocolServer: did_finish_download: Do not create 0 byte shared buffer
`PSClientConnection::did_finish_download()` no longer tries to create a zero byte shared buffer when `download.payload().data()` is zero bytes in length. Fixes #1821
This commit is contained in:
parent
d5fb916bf0
commit
0a483cf677
Notes:
sideshowbarker
2024-07-19 07:32:18 +09:00
Author: https://github.com/bcoles Commit: https://github.com/SerenityOS/serenity/commit/0a483cf6774 Pull-request: https://github.com/SerenityOS/serenity/pull/1822 Issue: https://github.com/SerenityOS/serenity/issues/1821
1 changed files with 1 additions and 1 deletions
|
@ -79,7 +79,7 @@ OwnPtr<Messages::ProtocolServer::StopDownloadResponse> PSClientConnection::handl
|
|||
void PSClientConnection::did_finish_download(Badge<Download>, Download& download, bool success)
|
||||
{
|
||||
RefPtr<SharedBuffer> buffer;
|
||||
if (success && !download.payload().is_null()) {
|
||||
if (success && download.payload().size() > 0 && !download.payload().is_null()) {
|
||||
buffer = SharedBuffer::create_with_size(download.payload().size());
|
||||
memcpy(buffer->data(), download.payload().data(), download.payload().size());
|
||||
buffer->seal();
|
||||
|
|
Loading…
Reference in a new issue