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

Unified Diff: tools/ipc_fuzzer/fuzzer/fuzzer.cc

Issue 2881673002: Avoid heap allocations in IPAddress (Closed)
Patch Set: New constructor Created 3 years, 7 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 | « remoting/host/ipc_host_event_logger.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ipc_fuzzer/fuzzer/fuzzer.cc
diff --git a/tools/ipc_fuzzer/fuzzer/fuzzer.cc b/tools/ipc_fuzzer/fuzzer/fuzzer.cc
index a8d3c6c4f3801901bf88ad6839c9abca5a47afdd..ecac51d7b68eb1c65b27d746210c1a6feb2df8d4 100644
--- a/tools/ipc_fuzzer/fuzzer/fuzzer.cc
+++ b/tools/ipc_fuzzer/fuzzer/fuzzer.cc
@@ -1291,10 +1291,10 @@ struct FuzzTraits<net::HostPortPair> {
template <>
struct FuzzTraits<net::IPAddress> {
static bool Fuzz(net::IPAddress* p, Fuzzer* fuzzer) {
- std::vector<uint8_t> bytes = p->bytes();
+ std::vector<uint8_t> bytes = p->CopyBytesToVector();
if (!FuzzParam(&bytes, fuzzer))
return false;
- net::IPAddress ip_address(bytes);
+ net::IPAddress ip_address(bytes.data(), bytes.size());
*p = ip_address;
return true;
}
« no previous file with comments | « remoting/host/ipc_host_event_logger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698