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

Unified Diff: net/http/http_util.h

Issue 7796025: Don't interpret embeded NULLs in a response header line as a line terminator. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address wtc comments Created 9 years, 3 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 | « net/http/http_response_headers.cc ('k') | net/http/http_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util.h
===================================================================
--- net/http/http_util.h (revision 100642)
+++ net/http/http_util.h (working copy)
@@ -131,6 +131,14 @@
// handling HTTP line continuations (i.e., lines starting with LWS are
// continuations of the previous line). |buf_len| indicates the position of
// the end-of-headers marker as defined by LocateEndOfHeaders.
+ // If a \0 appears within the headers themselves, it will be stripped. This
+ // is a workaround to avoid later code from incorrectly interpreting it as
+ // a line terminator.
+ //
+ // TODO(eroman): we should use \n as the canonical line separator rather than
+ // \0 to avoid this problem. Unfortunately the persistence layer
+ // is already dependent on newlines being replaced by NULL so
+ // this is hard to change without breaking things.
static std::string AssembleRawHeaders(const char* buf, int buf_len);
// Converts assembled "raw headers" back to the HTTP response format. That is
« no previous file with comments | « net/http/http_response_headers.cc ('k') | net/http/http_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698