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

Unified Diff: net/quic/core/quic_framer.cc

Issue 2669443003: Fix unchecked return value and uninitialized field. (Closed)
Patch Set: Created 3 years, 11 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 | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_framer.cc
diff --git a/net/quic/core/quic_framer.cc b/net/quic/core/quic_framer.cc
index 1ae1e3e72a1b25a31fc199d57af708a99f343ebb..0accae9a086b54d076f161916af2d0b6797d9b80 100644
--- a/net/quic/core/quic_framer.cc
+++ b/net/quic/core/quic_framer.cc
@@ -138,6 +138,7 @@ QuicFramer::QuicFramer(const QuicVersionVector& supported_versions,
largest_packet_number_(0),
last_path_id_(kInvalidPathId),
last_serialized_connection_id_(0),
+ last_version_tag_(0),
supported_versions_(supported_versions),
decrypter_level_(ENCRYPTION_NONE),
alternative_decrypter_level_(ENCRYPTION_NONE),
@@ -696,7 +697,9 @@ bool QuicFramer::AppendPacketHeader(const QuicPacketHeader& header,
if (header.public_header.version_flag) {
DCHECK_EQ(Perspective::IS_CLIENT, perspective_);
QuicTag tag = QuicVersionToQuicTag(quic_version_);
- writer->WriteUInt32(tag);
+ if (!writer->WriteUInt32(tag)) {
+ return false;
+ }
QUIC_DVLOG(1) << ENDPOINT << "version = " << quic_version_ << ", tag = '"
<< QuicTagToString(tag) << "'";
}
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698