websocketsession添加防御代码

This commit is contained in:
aozhiwei 2019-09-25 14:13:36 +08:00
parent c9e2386f8e
commit f93c9872e3

View File

@ -212,16 +212,20 @@ namespace a8
Close();
return;
}
if (opcode != BINARY_MODE) {
Close();
return;
}
if (!is_final_frame) {
Close();
return;
}
bool is_masked = (mask_payloadlen & 0x80) == 0x80;
if (opcode != BINARY_MODE) {
if (!is_masked) {
Close();
return;
}
assert(opcode == BINARY_MODE);
assert(is_masked);
unsigned char payloadlen = mask_payloadlen & 0x7F;
unsigned int framelen = 0;