Skip to content

Commit 646792f

Browse files
authored
iwdp_on_frame: reject unmasked frames before buffering, then drop the connection (#444)
1 parent dbc1eb1 commit 646792f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/ios_webkit_debug_proxy.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,15 +1097,15 @@ ws_status iwdp_on_frame(ws_t ws,
10971097
switch (opcode) {
10981098
case OPCODE_TEXT:
10991099
case OPCODE_BINARY:
1100+
if (!is_masking) {
1101+
ws->send_close(ws, CLOSE_PROTOCOL_ERROR, "Clients must mask");
1102+
return WS_ERROR;
1103+
}
11001104
if (!is_fin) {
11011105
// wait for full data
11021106
*to_keep = true;
11031107
return WS_SUCCESS;
11041108
}
1105-
if (!is_masking) {
1106-
return ws->send_close(ws, CLOSE_PROTOCOL_ERROR,
1107-
"Clients must mask");
1108-
}
11091109
iwdp_iport_t iport = iws->iport;
11101110
iwdp_iwi_t iwi = iport->iwi;
11111111
if (!iwi) {

0 commit comments

Comments
 (0)