commit | 07dd79b2708bedb245eb04fb8465df6cb99dda62 | [log] [tgz] |
---|---|---|
author | Jamie Walch <[email protected]> | Fri Sep 27 02:42:45 2019 |
committer | Commit Bot <[email protected]> | Fri Sep 27 02:42:45 2019 |
tree | 77d0bbb4942ba37070c473dd48b99ce03b84b359 | |
parent | 8781bd30ff1800de2aa97b1e1b5e405792733563 [diff] [blame] |
Don't send cursor shape messages if they are too large. Bug: 1008668 Change-Id: I600b369cb5a4a8cfa8cb0cf3dac025457cabbd52 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1828357 Reviewed-by: Erik Jensen <[email protected]> Commit-Queue: Jamie Walch <[email protected]> Cr-Commit-Position: refs/heads/master@{#700559}
diff --git a/remoting/protocol/host_control_dispatcher.cc b/remoting/protocol/host_control_dispatcher.cc index 9aa060f..b383308d 100644 --- a/remoting/protocol/host_control_dispatcher.cc +++ b/remoting/protocol/host_control_dispatcher.cc
@@ -67,6 +67,14 @@ const CursorShapeInfo& cursor_shape) { ControlMessage message; message.mutable_cursor_shape()->CopyFrom(cursor_shape); + std::size_t message_size = message.ByteSizeLong(); + if (message_size > max_message_size_) { + // Better to drop the event than drop the connection, which can happen if + // the browser receives a message larger than it can handle. + LOG(WARNING) << "Cursor message dropped because message size " + << message_size << " is larger than " << max_message_size_; + return; + } message_pipe()->Send(&message, base::Closure()); }