diff options
author | Jan Holesovsky <kendy@collabora.com> | 2016-11-08 13:10:28 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-11-09 09:40:54 +0100 |
commit | d02a99b9d8684525e91716f8aac3e3979e1cc200 (patch) | |
tree | 449941fe201ab0be70b93c7a386285325e19d68d | |
parent | 29a7cc1bee9fc22ffa29150b9a6337913518a3d0 (diff) |
Make sure we resize the payload to the amount of read bytes.
Change-Id: I33f032182912b4f03d073258c91974518db327fd
(cherry picked from commit 66053621bd859f19ee8fa522f0be85860ac4487d)
-rw-r--r-- | loolwsd/IoUtil.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/loolwsd/IoUtil.cpp b/loolwsd/IoUtil.cpp index 90483ac82..085422d91 100644 --- a/loolwsd/IoUtil.cpp +++ b/loolwsd/IoUtil.cpp @@ -155,6 +155,7 @@ void SocketProcessor(const std::shared_ptr<WebSocket>& ws, payload.resize(size); n = ws->receiveFrame(payload.data(), size, flags); + payload.resize(n > 0 ? n : 0); } } |