mirror of
https://github.com/LibreOffice/online.git
synced 2025-08-13 13:17:07 +00:00
Avoid taking address over the end of a vector if reading 0 bytes.
Happens with some close frames eg. [ docbroker_001 ] TRC #21: Incoming WebSocket data of 6 bytes: 88 80 4a 2c 44 f9 | ..J,D.| fin = true OpCode is Close (= 0x8) hasMask = true payloadLen = 0 headerLen = 2 -> 6 after hasMask is taken into account. Change-Id: I0e212e4589c3cc63db16f7065dc90cd0bd539ada
This commit is contained in:
@ -607,6 +607,9 @@ protected:
|
||||
|
||||
void readPayload(unsigned char *data, size_t dataLen, unsigned char* mask, std::vector<char>& payload)
|
||||
{
|
||||
if (dataLen == 0)
|
||||
return;
|
||||
|
||||
if (mask)
|
||||
{
|
||||
size_t end = payload.size();
|
||||
|
Reference in New Issue
Block a user