[Libreoffice-commits] online.git: net/WebSocketHandler.hpp
Michael Meeks (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jan 6 15:34:46 UTC 2020
net/WebSocketHandler.hpp | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 7788bd9268ba0e148ed7572586ff6068cb3f68d1
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Mon Jan 6 15:10:02 2020 +0000
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Jan 6 15:34:24 2020 +0000
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
diff --git a/net/WebSocketHandler.hpp b/net/WebSocketHandler.hpp
index 1d24fa26a..17d364d3a 100644
--- a/net/WebSocketHandler.hpp
+++ b/net/WebSocketHandler.hpp
@@ -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();
More information about the Libreoffice-commits
mailing list