websocketsession添加防御代码

This commit is contained in:
aozhiwei 2019-09-25 13:48:33 +08:00
parent ee4ceec3d9
commit 98af57041d

View File

@ -191,6 +191,9 @@ namespace a8
void WebSocketSession::DecodeFrame(char* buf, int& offset, unsigned int buflen)
{
if (offset + 2 < buflen) {
return;
}
char* real_buf = buf + offset;
unsigned int ava_len = buflen - offset;
char header = real_buf[0];