Fix use after free issue in pending_stream_map_.
When QuicSession::ClosePendingStream, before remove the pending stream from the pending_stream_map_, QuicSession::SendRstStream is invoked to send a reset acknowledgement to the peer. In Chromium, QuicChromiumClientSession overrides SendRstStream method, and calls into GetOrCreateDynamicStreamImpl() to close the pending stream as well as remove from pending_stream_map_. QuicSession holding the already deleted iterator will attempt to remove the entry again. This change adds iterator check right before removing the entry to avoid use after free issue. Bug: 918849, 918890 Change-Id: I27b7a4433d6783e4484a5dcb49446d89e997b8bf Reviewed-on: https://chromium-review.googlesource.com/c/1394920 Commit-Queue: Zhongyi Shi <zhongyi@chromium.org> Reviewed-by:Nick Harper <nharper@chromium.org> Cr-Commit-Position: refs/heads/master@{#619806}
Showing
Please register or sign in to comment