diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-18 00:06:03 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-18 00:06:03 +0000 |
commit | fe04d47cc8aa21ac323d2b17901529631e08ce26 (patch) | |
tree | 5f1885aafc0111d445026dd9dd9f3050659252ae /net | |
parent | 80f4403e07631ebb4be039eef780d5f2cfb6ae30 (diff) | |
download | chromium_src-fe04d47cc8aa21ac323d2b17901529631e08ce26.zip chromium_src-fe04d47cc8aa21ac323d2b17901529631e08ce26.tar.gz chromium_src-fe04d47cc8aa21ac323d2b17901529631e08ce26.tar.bz2 |
[SPDY] Avoid crash when an active stream closes another when it is closed
This CL is as small as possible as it might need to be merged to other
branches. Tests will come in a future CL.
BUG=250841
R=rch@chromium.org
Review URL: https://codereview.chromium.org/17066005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206851 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/spdy/spdy_session.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc index 8a5ba0d..9b10d2af 100644 --- a/net/spdy/spdy_session.cc +++ b/net/spdy/spdy_session.cc @@ -1230,13 +1230,17 @@ void SpdySession::CloseAllStreamsAfter(SpdyStreamId last_good_stream_id, } } - ActiveStreamMap::iterator it = - active_streams_.lower_bound(last_good_stream_id + 1); - while (it != active_streams_.end()) { + // The loops below are carefully written to avoid problems with + // streams closing other streams. + + while (true) { + ActiveStreamMap::iterator it = + active_streams_.lower_bound(last_good_stream_id + 1); + if (it == active_streams_.end()) + break; SpdyStreamId stream_id = it->first; streams_abandoned_count_++; LogAbandonedStream(it->second, status); - ++it; CloseActiveStream(stream_id, status); } |