check max frame size

This commit is contained in:
Benjamin Sergeant 2019-10-26 11:48:03 -07:00
parent ebb31b4e87
commit 499262f752

View File

@ -542,6 +542,13 @@ namespace ix
ws.masking_key[3] = 0;
}
// Prevent integer overflow in the next conditional
const uint64_t maxFrameSize(1 << 63);
if (ws.N > maxFrameSize)
{
return;
}
if (_rxbuf.size() < ws.header_size + ws.N)
{
return; /* Need: ws.header_size+ws.N - _rxbuf.size() */