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); |