From 84b562f4cc01dc7a292ac4ff26703d4e3ac3ce29 Mon Sep 17 00:00:00 2001 From: "mbelshe@google.com" Date: Fri, 20 Nov 2009 18:25:30 +0000 Subject: Robustness improvements on the X-Associated-Content header. If we get a header which doesn't look like it contains a parseable URL, log an error and drop it (instead of inserting it into the pending_streams_ list). BUG=none TEST=none Review URL: http://codereview.chromium.org/420002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32629 0039d316-1c4b-4281-b951-d872f2087c98 --- net/flip/flip_session.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc index 82aa9b8..8164f1d 100644 --- a/net/flip/flip_session.cc +++ b/net/flip/flip_session.cc @@ -694,9 +694,13 @@ void FlipSession::OnSynReply(const flip::FlipSynReplyControlFrame* frame, break; url = url.substr(pos + 2); GURL gurl(url); - pending_streams_[gurl.PathForRequest()] = NULL; + std::string path = gurl.PathForRequest(); + if (path.length()) + pending_streams_[path] = NULL; + else + LOG(INFO) << "Invalid X-Associated-Content path: " << url; start = end + 2; - } while (end < content.length()); + } while (start < content.length()); } FlipStream* stream = active_streams_[stream_id]; @@ -709,6 +713,7 @@ void FlipSession::OnControl(const flip::FlipControlFrame* frame) { if (type == flip::SYN_STREAM || type == flip::SYN_REPLY) { if (!flip_framer_.ParseHeaderBlock(frame, &headers)) { LOG(WARNING) << "Could not parse Flip Control Frame Header"; + // TODO(mbelshe): Error the session? return; } } -- cgit v1.1