summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2011-09-25 10:46:31 +0100
committerAndy Green <andy@warmcat.com>2011-09-25 10:46:31 +0100
commit5bf65788ea380e1e4d6a978bb4459807a14c2724 (patch)
tree8f262822f1a26683e4411c57f3bf5f08e7a72c13
parentf24311527e97d03b21bc06f849f29f6d24fbdb9b (diff)
fix failure to limit 7bit lengthssupport-protocol-v8-chrome-15-firefox-6
Reported-by: Tran Le Hung <tranhung44@gmail.com> Reported-by: Tobias Maier <tobias.maier@netplace.com> Signed-off-by: Andy Green <andy@warmcat.com>
-rw-r--r--lib/parsers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/parsers.c b/lib/parsers.c
index 52f1b7d..01d360b 100644
--- a/lib/parsers.c
+++ b/lib/parsers.c
@@ -495,7 +495,7 @@ handle_first:
wsi->this_frame_masked = !!(c & 0x80);
- switch (c) {
+ switch (c & 0x7f) {
case 126:
/* control frames are not allowed to have big lengths */
if (wsi->opcode & 8)
@@ -959,7 +959,7 @@ int libwebsocket_client_rx_sm(struct libwebsocket *wsi, unsigned char c)
wsi->this_frame_masked = !!(c & 0x80);
- switch (c) {
+ switch (c & 0x7f) {
case 126:
/* control frames are not allowed to have big lengths */
if (wsi->opcode & 8)