diff options
author | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-13 04:55:18 +0000 |
---|---|---|
committer | eroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-13 04:55:18 +0000 |
commit | 2bcaf4649c1d495072967ea454e8c16dce044705 (patch) | |
tree | f50fe18bf174de3ea8c3edfacb012b3715ba8fb7 /net/http/http_util.h | |
parent | b169638f8115c39974ec37e0046b30df8de95f76 (diff) | |
download | chromium_src-2bcaf4649c1d495072967ea454e8c16dce044705.zip chromium_src-2bcaf4649c1d495072967ea454e8c16dce044705.tar.gz chromium_src-2bcaf4649c1d495072967ea454e8c16dce044705.tar.bz2 |
Don't interpret embeded NULLs in a response header line as a line terminator.
BUG=95992
Review URL: http://codereview.chromium.org/7796025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100863 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_util.h')
-rw-r--r-- | net/http/http_util.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/http/http_util.h b/net/http/http_util.h index e9e025e..c9ead08 100644 --- a/net/http/http_util.h +++ b/net/http/http_util.h @@ -131,6 +131,14 @@ class NET_EXPORT HttpUtil { // 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 |