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

Unified Diff: net/dns/dns_transaction.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 | « net/dns/dns_session.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_transaction.cc
diff --git a/net/dns/dns_transaction.cc b/net/dns/dns_transaction.cc
index 03eb7f26947887fdcb50a5cc9dc3c85968bd8b94..beb2197dd55b7bc50d39c71cb70d46c29bfd2a77 100644
--- a/net/dns/dns_transaction.cc
+++ b/net/dns/dns_transaction.cc
@@ -392,8 +392,10 @@ class DnsTCPAttempt : public DnsAttempt {
if (rv < 0)
return rv;
- base::WriteBigEndian<uint16>(length_buffer_->data(),
- query_->io_buffer()->size());
+ uint16 query_size = static_cast<uint16>(query_->io_buffer()->size());
+ if (static_cast<int>(query_size) != query_->io_buffer()->size())
+ return ERR_FAILED;
+ base::WriteBigEndian<uint16>(length_buffer_->data(), query_size);
buffer_ =
new DrainableIOBuffer(length_buffer_.get(), length_buffer_->size());
next_state_ = STATE_SEND_LENGTH;
« no previous file with comments | « net/dns/dns_session.cc ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698