Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(949)

Unified Diff: mojo/fetcher/data_fetcher.cc

Issue 1356503003: data-fetcher: Discard really big data URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/fetcher/data_fetcher.cc
diff --git a/mojo/fetcher/data_fetcher.cc b/mojo/fetcher/data_fetcher.cc
index e785be7be9d074f41d927114d831e8e3abf199e4..51c25a8e8a73f8a74de61ae05e0cc61f4fd88a1f 100644
--- a/mojo/fetcher/data_fetcher.cc
+++ b/mojo/fetcher/data_fetcher.cc
@@ -18,6 +18,8 @@ namespace fetcher {
ScopedDataPipeConsumerHandle CreateConsumerHandleForString(
const std::string& data) {
+ if (data.size() > std::numeric_limits<uint32_t>::max())
+ return ScopedDataPipeConsumerHandle();
uint32_t num_bytes = static_cast<uint32_t>(data.size());
MojoCreateDataPipeOptions options;
options.struct_size = sizeof(MojoCreateDataPipeOptions);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698