Browse Source

fix: copy received data in URLPipeLoader to prevent corruption (#29669)

Co-authored-by: David Sanders <[email protected]>
trop[bot] 3 years ago
parent
commit
4cecc87c55
1 changed files with 1 additions and 1 deletions
  1. 1 1
      shell/browser/net/url_pipe_loader.cc

+ 1 - 1
shell/browser/net/url_pipe_loader.cc

@@ -85,7 +85,7 @@ void URLPipeLoader::OnDataReceived(base::StringPiece string_piece,
   producer_->Write(
       std::make_unique<mojo::StringDataSource>(
           string_piece, mojo::StringDataSource::AsyncWritingMode::
-                            STRING_STAYS_VALID_UNTIL_COMPLETION),
+                            STRING_MAY_BE_INVALIDATED_BEFORE_COMPLETION),
       base::BindOnce(&URLPipeLoader::OnWrite, weak_factory_.GetWeakPtr(),
                      std::move(resume)));
 }