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

Unified Diff: net/spdy/spdy_framer.cc

Issue 2805066: SPDY: Handle incorrect number of headers when parsing frame headers. (Closed)
Patch Set: Created 10 years, 6 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 | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.cc
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index 0a1c2b74a12a8340c818b95dbc2d194af7f3660a..cd573a5631e166ae758fb0e478f1ef8e136798cb 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -470,7 +470,8 @@ bool SpdyFramer::ParseHeaderBlock(const SpdyFrame* frame,
void* iter = NULL;
uint16 num_headers;
if (builder.ReadUInt16(&iter, &num_headers)) {
- for (int index = 0; index < num_headers; ++index) {
+ int index = 0;
+ for ( ; index < num_headers; ++index) {
std::string name;
std::string value;
if (!builder.ReadString(&iter, &name))
@@ -485,7 +486,8 @@ bool SpdyFramer::ParseHeaderBlock(const SpdyFrame* frame,
return false;
}
}
- return true;
+ return index == num_headers &&
+ iter == header_data + header_length;
}
return false;
}
« no previous file with comments | « no previous file | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698