Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(613)

Unified Diff: net/websockets/websocket_channel.cc

Issue 177403002: net::WebSocketChannel should reject reserved bits (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix typo. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/websockets/websocket_channel_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_channel.cc
diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc
index a9600986ecb382bca810cab968dff410158fa533..dc8eb8aa35c463c2d65649800e5f525fbf9eb5a3 100644
--- a/net/websockets/websocket_channel.cc
+++ b/net/websockets/websocket_channel.cc
@@ -653,6 +653,12 @@ ChannelState WebSocketChannel::HandleFrame(
kWebSocketErrorProtocolError,
"Control message with FIN bit unset received");
}
+ if (frame->header.reserved1 || frame->header.reserved2 ||
+ frame->header.reserved3) {
+ return FailChannel("Received a frame with an invalid reserved bit set.",
+ kWebSocketErrorProtocolError,
+ "Invalid reserved bit");
+ }
// Respond to the frame appropriately to its type.
return HandleFrameByState(
« no previous file with comments | « no previous file | net/websockets/websocket_channel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698