Skip to content

Commit

Permalink
Fix crash in WebSocketChannel::ReadFrames
Browse files Browse the repository at this point in the history
RespondToClosingHandshake can fail, and in that case we must stop using
the net::WebSocketChannel instance.

Bug: 994000
Change-Id: Ibaba2c552cfba59c3d95f63f0d9e807df4c4f564
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1830492
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701047}
  • Loading branch information
yutakahirano authored and Commit Bot committed Sep 30, 2019
1 parent c16f797 commit d933173
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/websockets/websocket_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,9 @@ ChannelState WebSocketChannel::ReadFrames() {
DCHECK(!event_interface_->HasPendingDataFrames());
// We've been waiting for the client to consume the frames before
// responding to the closing handshake initiated by the server.
ignore_result(RespondToClosingHandshake());
if (RespondToClosingHandshake() == CHANNEL_DELETED) {
return CHANNEL_DELETED;
}
}

// TODO(crbug.com/999235): Remove this CHECK.
Expand Down

0 comments on commit d933173

Please sign in to comment.