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

Unified Diff: net/spdy/header_coalescer.cc

Issue 2710053002: HTTP/2 Check header names in HeaderCoalescer (Closed)
Patch Set: Created 3 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/header_coalescer.cc
diff --git a/net/spdy/header_coalescer.cc b/net/spdy/header_coalescer.cc
index 497c07991983a5423c77a16b6e4178d74736521d..99e60dafe507130975705b5e83455bfd8c3e3d98 100644
--- a/net/spdy/header_coalescer.cc
+++ b/net/spdy/header_coalescer.cc
@@ -24,6 +24,12 @@ void HeaderCoalescer::OnHeader(base::StringPiece key, base::StringPiece value) {
return;
}
+ // RFC 7540 Section 8.1.2 says that header field names are ASCII characters.
+ if (!base::IsStringASCII(key)) {
asanka 2017/02/22 19:44:13 Consider using something like HttpUtil::IsValidHea
xunjieli 2017/02/22 20:14:51 Done. Thanks for the suggestion!
+ error_seen_ = true;
+ return;
+ }
+
// 32 byte overhead according to RFC 7540 Section 6.5.2.
header_list_size_ += key.size() + value.size() + 32;
if (header_list_size_ > kMaxHeaderListSize) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698