websocketsession添加防御代码
This commit is contained in:
parent
c9e2386f8e
commit
f93c9872e3
@ -212,16 +212,20 @@ namespace a8
|
|||||||
Close();
|
Close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (opcode != BINARY_MODE) {
|
||||||
|
Close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!is_final_frame) {
|
if (!is_final_frame) {
|
||||||
|
Close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_masked = (mask_payloadlen & 0x80) == 0x80;
|
bool is_masked = (mask_payloadlen & 0x80) == 0x80;
|
||||||
if (opcode != BINARY_MODE) {
|
if (!is_masked) {
|
||||||
|
Close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
assert(opcode == BINARY_MODE);
|
|
||||||
assert(is_masked);
|
|
||||||
|
|
||||||
unsigned char payloadlen = mask_payloadlen & 0x7F;
|
unsigned char payloadlen = mask_payloadlen & 0x7F;
|
||||||
unsigned int framelen = 0;
|
unsigned int framelen = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user